Merge pull request 'Added a drop on use for each card' (#1) from jason-add-cards-to-drop into main

Reviewed-on: #1
This commit is contained in:
Jason Liszka 2023-02-19 18:44:26 -05:00
commit fe092e17df
2 changed files with 41 additions and 34 deletions

View File

@ -10,7 +10,6 @@ TODO:
- Crafting Recipe (Figure out what I want it to be or if there will be a recipe)
- Make card pack drop items instead of adding directly to inventory.
- Add pack to dungeon loot
- Decide if I want cards to drop the item that it is (example: Apple Tree card on use give apple tree log)
- Better Card art
- Add other cards based on other mods (and figure out what those cards will be)
- Blobcat Cards

View File

@ -2,55 +2,55 @@ common_cards = {
{name = "card_default_tree", description = "Apple Tree Card\nMTG Card #1", on_use_item = "default:tree 5"},
{name = "card_default_acacia_tree", description = "Acacia Tree Card\nMTG Card #2", on_use_item = "default:acacia_tree 5"},
{name = "card_default_aspen_tree", description = "Aspen Tree Card\nMTG Card #3", on_use_item = "default:aspen_tree 5"},
{name = "card_default_jungle_tree", description = "Jungle Tree Card\nMTG Card #4", on_use_item = "default:jungle_tree 5"},
{name = "card_default_jungle_tree", description = "Jungle Tree Card\nMTG Card #4", on_use_item = "default:jungletree 5"},
{name = "card_default_pine_tree", description = "Pine Tree Card\nMTG Card #5", on_use_item = "default:pine_tree 5"},
{name = "card_default_tool_stone_pickaxe", description = "Stone Pickaxe Card\nMTG Card #6", on_use_item = "default:tool_stone 1"},
{name = "card_default_tool_stone_axe", description = "Stone Axe Card\nMTG Card #7", on_use_item = "default:tool_stone 1"},
{name = "card_default_tool_stone_sword", description = "Stone Sword Card\nMTG Card #8", on_use_item = "default:tool_stone 1"},
{name = "card_default_tool_stone_shovel", description = "Stone Shovel Card\nMTG Card #9", on_use_item = "default:tool_stone 1"},
{name = "card_default_tool_stone_pickaxe", description = "Stone Pickaxe Card\nMTG Card #6", on_use_item = "default:pick_stone 1"},
{name = "card_default_tool_stone_axe", description = "Stone Axe Card\nMTG Card #7", on_use_item = "default:axe_stone 1"},
{name = "card_default_tool_stone_sword", description = "Stone Sword Card\nMTG Card #8", on_use_item = "default:sword_stone 1"},
{name = "card_default_tool_stone_shovel", description = "Stone Shovel Card\nMTG Card #9", on_use_item = "default:shovel_stone 1"},
{name = "card_default_tool_wood_pickaxe", description = "Wood Pickaxe Card\nMTG Card #10", on_use_item = "default:tool_wood 1"},
{name = "card_default_tool_wood_axe", description = "Wood Axe Card\nMTG Card #11", on_use_item = "default:tool_wood 1"},
{name = "card_default_tool_wood_sword", description = "Wood Sword Card\nMTG Card #12", on_use_item = "default:tool_wood 1"},
{name = "card_default_tool_wood_shovel", description = "Wood Shovel Card\nMTG Card #13", on_use_item = "default:tool_wood 1"},
{name = "card_default_tool_wood_pickaxe", description = "Wood Pickaxe Card\nMTG Card #10", on_use_item = "default:pick_wood 1"},
{name = "card_default_tool_wood_axe", description = "Wood Axe Card\nMTG Card #11", on_use_item = "default:axe_wood 1"},
{name = "card_default_tool_wood_sword", description = "Wood Sword Card\nMTG Card #12", on_use_item = "default:sword_wood 1"},
{name = "card_default_tool_wood_shovel", description = "Wood Shovel Card\nMTG Card #13", on_use_item = "default:shovel_stone 1"},
{name = "card_default_coal_lump", description = "Coal Card\nMTG Card #14", on_use_item = "default: 5"},
{name = "card_default_copper_lump", description = "Copper Card\nMTG Card #15", on_use_item = "default: 5"},
{name = "card_default_iron_lump", description = "Iron Card\nMTG Card #16", on_use_item = "default: 5"},
{name = "card_default_tin_lump", description = "Tin Card\nMTG Card #17", on_use_item = "default: 5"},
{name = "card_default_coal_lump", description = "Coal Card\nMTG Card #14", on_use_item = "default:coal_lump 5"},
{name = "card_default_copper_lump", description = "Copper Card\nMTG Card #15", on_use_item = "default:copper_lump 5"},
{name = "card_default_iron_lump", description = "Iron Card\nMTG Card #16", on_use_item = "default:iron_lump 5"},
{name = "card_default_tin_lump", description = "Tin Card\nMTG Card #17", on_use_item = "default:tin_lump 5"},
}
uncommon_cards = {
{name = "card_default_tool_bronze_pickaxe", description = "Bronze Pickaxe Card\nMTG Card #18"},
{name = "card_default_tool_bronze_axe", description = "Bronze Axe Card\nMTG Card #19"},
{name = "card_default_tool_bronze_sword", description = "Bronze Sword Card\nMTG Card #20"},
{name = "card_default_tool_bronze_shovel", description = "Bronze Shovel Tree Card\nMTG Card #21"},
{name = "card_default_tool_bronze_pickaxe", description = "Bronze Pickaxe Card\nMTG Card #18", on_use_item = "default:pick_bronze 1"},
{name = "card_default_tool_bronze_axe", description = "Bronze Axe Card\nMTG Card #19", on_use_item = "default:axe_bronze 1"},
{name = "card_default_tool_bronze_sword", description = "Bronze Sword Card\nMTG Card #20", on_use_item = "default:sword_bronze 1"},
{name = "card_default_tool_bronze_shovel", description = "Bronze Shovel Tree Card\nMTG Card #21", on_use_item = "default:shovel_bronze 1"},
{name = "card_default_gold_lump", description = "Gold Card\nMTG Card #22"},
{name = "card_default_gold_lump", description = "Gold Card\nMTG Card #22", on_use_item = "default:gold_lump 1",},
}
rare_cards = {
{name = "card_default_mese_crystal", description = "Mese Crystal Card\nMTG Card #23"},
{name = "card_default_mese_crystal", description = "Mese Crystal Card\nMTG Card #23", on_use_item = "default:mese_crystal 1"},
{name = "card_default_tool_steel_pickaxe", description = "Steel Pickaxe Card\nMTG Card #24"},
{name = "card_default_tool_steel_axe", description = "Steel Axe Card\nMTG Card #25"},
{name = "card_default_tool_steel_sword", description = "Steel Sword Card\nMTG Card #26"},
{name = "card_default_tool_steel_shovel", description = "Steel Shovel Tree Card\nMTG Card #27"},
{name = "card_default_tool_steel_pickaxe", description = "Steel Pickaxe Card\nMTG Card #24", on_use_item = "default:pick_steel 1"},
{name = "card_default_tool_steel_axe", description = "Steel Axe Card\nMTG Card #25", on_use_item = "default:axe_steel 1"},
{name = "card_default_tool_steel_sword", description = "Steel Sword Card\nMTG Card #26", on_use_item = "default:sword_steel 1"},
{name = "card_default_tool_steel_shovel", description = "Steel Shovel Tree Card\nMTG Card #27", on_use_item = "default:shovel_steel 1"},
}
super_rare_cards = {
{name = "card_default_tool_diamond_pickaxe", description = "Diamond Pickaxe Card\nMTG Card #28"},
{name = "card_default_tool_diamond_axe", description = "Diamond Axe Card\nMTG Card #29"},
{name = "card_default_tool_diamond_sword", description = "Diamond Sword Card\nMTG Card #30"},
{name = "card_default_tool_diamond_shovel", description = "Diamond Shovel Tree Card\nMTG Card #31"},
{name = "card_default_tool_diamond_pickaxe", description = "Diamond Pickaxe Card\nMTG Card #28", on_use_item = "default:pick_diamond 1"},
{name = "card_default_tool_diamond_axe", description = "Diamond Axe Card\nMTG Card #29", on_use_item = "default:axe_diamond 1"},
{name = "card_default_tool_diamond_sword", description = "Diamond Sword Card\nMTG Card #30", on_use_item = "default:sword_diamond 1"},
{name = "card_default_tool_diamond_shovel", description = "Diamond Shovel Tree Card\nMTG Card #31", on_use_item = "default:shovel_diamond 1"},
{name = "card_default_tool_mese_pickaxe", description = "Mese Pickaxe Card\nMTG Card #32"},
{name = "card_default_tool_mese_axe", description = "Mese Axe Card\nMTG Card #33"},
{name = "card_default_tool_mese_sword", description = "Mese Sword Card\nMTG Card #34"},
{name = "card_default_tool_mese_shovel", description = "Mese Shovel Tree Card\nMTG Card #35"},
{name = "card_default_tool_mese_pickaxe", description = "Mese Pickaxe Card\nMTG Card #32", on_use_item = "default:pick_mese 1"},
{name = "card_default_tool_mese_axe", description = "Mese Axe Card\nMTG Card #33", on_use_item = "default:axe_mese 1"},
{name = "card_default_tool_mese_sword", description = "Mese Sword Card\nMTG Card #34", on_use_item = "default:sword_mese 1"},
{name = "card_default_tool_mese_shovel", description = "Mese Shovel Tree Card\nMTG Card #35", on_use_item = "default:shovel_mese 1"},
{name = "card_default_diamond", description = "Diamond Card\nMTG Card #37"},
{name = "card_default_diamond", description = "Diamond Card\nMTG Card #37", on_use_item = "default:diamond 1"},
}
function generate_cards(cards)
@ -61,7 +61,15 @@ function generate_cards(cards)
description = cards[key]["description"],
inventory_image = card_image,
on_use = function(itemstack, user, pointed_thing)
minetest.chat_send_player(user:get_player_name(), "Used Item")
if user:get_inventory():room_for_item("main",cards[key]["on_use_item"])
then
itemstack:take_item()
user:get_inventory():add_item("main", cards[key]["on_use_item"])
else
minetest.chat_send_player(user:get_player_name(), "No Room in inventory")
end
return itemstack
end,
})
end