added opium poppy and opium

master
aegroto 2018-09-16 16:55:16 +02:00
parent b9a0e974bd
commit ff18de1fdc
19 changed files with 178 additions and 8 deletions

6
.directory Normal file
View File

@ -0,0 +1,6 @@
[Dolphin]
Timestamp=2018,9,9,19,31,10
Version=3
[Settings]
HiddenFilesShown=true

View File

@ -10,8 +10,13 @@ Most aspects of the mod are configurable by editing config.lua
Dependencies are stored in depends.txt
## **Plants**
Drug seed are rarely dropped by common grass. They can be used to grow plants which produce raw elements to be refined to drugs.
### **Harvesting notes**
**Opium Poppy** : The plant drops more raw opium on not mature stages (6 and 7) while dropping more petals when bloomed.
## **Drugs**
Using drugs leads to immediate buffs and debuffs and aftereffects.
@ -23,9 +28,10 @@ If a drug is assumable using pipes, It should be placed in the inventory stack s
Name | Assumption tool | Immediate effects | Aftereffects | Addiction's increase
--- | --- | --- | --- | ---
**Weed** | Wooden pipe | Slighly heals and increases defense while reducing movement speed and increasing hunger | Gives weak damage | Low
**Hashish** | Wooden pipe | Moderately heals and increases defense while reducing movement speed and increasing hunger | Gives weak damage | Low
**Hashish** | Wooden pipe | Same as weed, but with increased effects and duration | Same as weed, but with increased effects and duration | Low
**Cocaine** | Direct | Increases movement speed, damage and reduces hunger | Gives moderate damage | High
**Crack** | Glass pipe | Same as cocaine, but less durable and higher addictive | Same as cocaine, but less durable and higher addictive | High
**Opium** | Wooden pipe | Moderately heals and increases defense while reducing movement speed | Gives moderate damage | Very high
## **Weapons and tools**

View File

@ -19,7 +19,7 @@ minetest.register_node("drug_wars:seed_cannabis", {
for i = 4, 5 do
local node_name = "default:grass_" .. i
drug_wars.add_node_drops(node_name, {items = {'drug_wars:seed_cannabis'}, rarity = 15});
drug_wars.add_node_drops(node_name, {items = {'drug_wars:seed_cannabis'}, rarity = 35});
end
-- cannabis drops

View File

@ -19,7 +19,7 @@ minetest.register_node("drug_wars:seed_coca", {
for i = 4, 5 do
local node_name = "default:grass_" .. i
drug_wars.add_node_drops(node_name, {items = {'drug_wars:seed_coca'}, rarity = 20});
drug_wars.add_node_drops(node_name, {items = {'drug_wars:seed_coca'}, rarity = 45});
end
-- coca drops

View File

@ -1,6 +1,7 @@
--partial enabling/disabling options
drug_wars.ENABLE_CANNABIS = true
drug_wars.ENABLE_COCA = true
drug_wars.ENABLE_OPIUMPOPPY = true
drug_wars.ENABLE_INVSEARCH = true
drug_wars.ENABLE_MACHETES = true
drug_wars.ENABLE_PIPES = true
@ -17,14 +18,14 @@ drug_wars.ADDICTION_TICK = 60
drug_wars.ADDICTION_REDUCTION = 0.05
drug_wars.ADDICTION_REDUCTION_THRESHOLD = 0.05
drug_wars.ADDICTION_DAMAGE = 4
drug_wars.ADDICTION_DAMAGE_THRESHOLD = 0.35
drug_wars.ADDICTION_DAMAGE_THRESHOLD = 0.2
-- weed stats
drug_wars.WEED_SPEED_DEBUFF = 0.2
drug_wars.WEED_SPEED_DEBUFF_THRESHOLD = 0.4
drug_wars.WEED_HUNGER_DEBUFF = 4
drug_wars.WEED_HEAL = 2
drug_wars.WEED_DEFENSE_BUFF = 0.15
drug_wars.WEED_HEAL = 2
drug_wars.WEED_DEFENSE_BUFF = 0.1
drug_wars.WEED_ADDICTION = 0.02
drug_wars.WEED_ADDICTION_THRESHOLD = 0.5
drug_wars.WEED_DURATION = 30
@ -34,7 +35,7 @@ drug_wars.HASHISH_SPEED_DEBUFF = 0.25
drug_wars.HASHISH_SPEED_DEBUFF_THRESHOLD = 0.4
drug_wars.HASHISH_HUNGER_DEBUFF = 6
drug_wars.HASHISH_HEAL = 3
drug_wars.HASHISH_DEFENSE_BUFF = 0.3
drug_wars.HASHISH_DEFENSE_BUFF = 0.15
drug_wars.HASHISH_ADDICTION = 0.05
drug_wars.HASHISH_ADDICTION_THRESHOLD = 0.5
drug_wars.HASHISH_DURATION = 60
@ -53,4 +54,12 @@ drug_wars.CRACK_HUNGER_BUFF = 8
drug_wars.CRACK_DAMAGE_BUFF = 0.25
drug_wars.CRACK_ADDICTION = 0.15
drug_wars.CRACK_DAMAGE = 3
drug_wars.CRACK_DURATION = 60
drug_wars.CRACK_DURATION = 60
-- opium stats
drug_wars.OPIUM_SPEED_DEBUFF = 0.5
drug_wars.OPIUM_SPEED_DEBUFF_THRESHOLD = 0.3
drug_wars.OPIUM_HEAL = 4
drug_wars.OPIUM_DEFENSE_BUFF = 0.25
drug_wars.OPIUM_ADDICTION = 0.2
drug_wars.OPIUM_DURATION = 90

View File

@ -31,3 +31,7 @@ end
if drug_wars.ENABLE_COCA then
dofile(drug_wars.path.."/coca.lua")
end
if drug_wars.ENABLE_OPIUMPOPPY then
dofile(drug_wars.path.."/opiumpoppy.lua")
end

145
opiumpoppy.lua Normal file
View File

@ -0,0 +1,145 @@
-- opium poppy seeds
minetest.register_node("drug_wars:seed_opiumpoppy", {
description = "Opium Poppy Seed",
tiles = {"drugwars_opiumpoppy_seed.png"},
inventory_image = "drugwars_opiumpoppy_seed.png",
wield_image = "drugwars_opiumpoppy_seed.png",
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = farming.select,
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "drug_wars:opiumpoppy_1")
end,
})
for i = 4, 5 do
local node_name = "default:grass_" .. i
drug_wars.add_node_drops(node_name, {items = {'drug_wars:seed_opiumpoppy'}, rarity = 50});
end
-- opium poppy drops
minetest.register_craftitem("drug_wars:raw_opium", {
description = "Raw Opium",
inventory_image = "drugwars_raw_opium.png",
})
minetest.register_craftitem("drug_wars:poppy_petal", {
description = "Poppy Petal",
inventory_image = "drugwars_poppy_petal.png",
})
-- opium refined items
minetest.register_craftitem("drug_wars:opium_ball", {
description = "Opium Ball",
inventory_image = "drugwars_opium_ball.png",
max_stack = 25,
on_smoke_woodenpipe = function(player)
if player ~= nil then
local playername = player:get_player_name()
player:set_hp(player:get_hp() + drug_wars.OPIUM_HEAL)
local speed_changed = drug_wars.speed_debuff(player, drug_wars.OPIUM_SPEED_DEBUFF, drug_wars.OPIUM_SPEED_DEBUFF_THRESHOLD)
drug_wars.defense_buff(playername, drug_wars.OPIUM_DEFENSE_BUFF)
drug_wars.increase_addiction(playername, drug_wars.OPIUM_ADDICTION)
table.insert(drug_wars.aftereffects, {
countdown = drug_wars.OPIUM_DURATION,
on_timeout = function()
if(speed_changed) then
drug_wars.speed_buff(player, drug_wars.OPIUM_SPEED_DEBUFF)
end
drug_wars.drug_damage(player, drug_wars.OPIUM_HEAL)
drug_wars.defense_buff(playername, -drug_wars.OPIUM_DEFENSE_BUFF)
end
})
end
end
})
-- craft usages
minetest.register_craft({
output = "default:paper 2",
recipe = {
{"drug_wars:poppy_petal", "drug_wars:poppy_petal", "drug_wars:poppy_petal"},
{"drug_wars:poppy_petal", "drug_wars:poppy_petal", "drug_wars:poppy_petal"},
{"drug_wars:poppy_petal", "drug_wars:poppy_petal", "drug_wars:poppy_petal"}
}
})
minetest.register_craft({
output = "drug_wars:opium_ball",
recipe = {
{"", "drug_wars:raw_opium", ""},
{"drug_wars:raw_opium", "drug_wars:raw_opium", "drug_wars:raw_opium"},
{"", "drug_wars:raw_opium", ""},
}
})
-- plant nodes definition
local crop_def = {
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
for i = 1,5 do
crop_def.tiles = {"drugwars_opiumpoppy_"..i..".png"}
crop_def.visual_scale = 0.7 + i / 10.0
minetest.register_node("drug_wars:opiumpoppy_"..i, table.copy(crop_def))
end
crop_def.drop = {
items = {
{items = {'drug_wars:raw_opium'}, rarity = 5},
{items = {'drug_wars:seed_opiumpoppy'}, rarity = 1}
}
}
crop_def.tiles = {"drugwars_opiumpoppy_6.png"}
crop_def.visual_scale = 0.7 + 6 / 10.0
minetest.register_node("drug_wars:opiumpoppy_6", table.copy(crop_def))
crop_def.drop = {
items = {
{items = {'drug_wars:raw_opium'}, rarity = 2},
{items = {'drug_wars:poppy_petal'}, rarity = 2},
{items = {'drug_wars:seed_opiumpoppy'}, rarity = 1}
}
}
crop_def.tiles = {"drugwars_opiumpoppy_7.png"}
crop_def.visual_scale = 0.7 + 7 / 10.0
minetest.register_node("drug_wars:opiumpoppy_7", table.copy(crop_def))
crop_def.drop = {
items = {
{items = {'drug_wars:raw_opium'}, rarity = 10},
{items = {'drug_wars:poppy_petal'}, rarity = 1},
{items = {'drug_wars:seed_opiumpoppy'}, rarity = 1}
}
}
crop_def.tiles = {"drugwars_opiumpoppy_8.png"}
crop_def.visual_scale = 0.7 + 8 / 10.0
minetest.register_node("drug_wars:opiumpoppy_8", table.copy(crop_def))

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B