Started partial implementation for per-phase gifts

This commit is contained in:
Hector Franqui 2016-11-19 08:04:45 -05:00
parent 7d85cdc063
commit 82b9d97d6f

155
npc.lua
View File

@ -9,77 +9,90 @@ npc = {}
npc.FEMALE = "female" npc.FEMALE = "female"
npc.MALE = "male" npc.MALE = "male"
npc.ITEM_GIFT_EFFECT = 2.5 npc.ITEM_GIFT_EFFECT = 2.5
npc.RELATIONSHIP_PHASE1_LIMIT = 10 npc.RELATIONSHIP_PHASE = {
npc.RELATIONSHIP_PHASE2_LIMIT = 25 phase1 = {limit = 10},
npc.RELATIONSHIP_PHASE3_LIMIT = 45 phase2 = {limit = 25},
npc.RELATIONSHIP_PHASE4_LIMIT = 70 phase3 = {limit = 45},
npc.RELATIONSHIP_PHASE5_LIMIT = 100 phase4 = {limit = 70},
phase5 = {limit = 100}
}
npc.FAVORITE_ITEMS = { npc.FAVORITE_ITEMS = {
female = { female = {
"default:apple", phase1 = {
"farming:bread", {item = "default:apple",
"mobs:meat", response = "Hey, I really wanted an apple, thank you!"},
"default:pick_steel", {item = "farming:bread",
"default:shovel_steel", response = "Thanks, you didn't have to, but thanks..."}
"default:sword_steel" },
phase2 = {
{item = "farming:cotton",
response = "This is going to be very helpful, thank you!"},
{item = "wool:wool",
response = "Thanks, you didn't have to, but thanks..."}
},
phase3 = {
{item = "default:apple",
response = "Hey, I really wanted an apple, thank you!"},
{item = "farming:bread",
response = "Thanks, you didn't have to, but thanks..."}
},
phase4 = {
{item = "default:apple",
response = "Hey, I really wanted an apple, thank you!"},
{item = "farming:bread",
response = "Thanks, you didn't have to, but thanks..."}
},
phase5 = {
{item = "default:apple",
response = "Hey, I really wanted an apple, thank you!"},
{item = "farming:bread",
response = "Thanks, you didn't have to, but thanks..."}
},
phase6 = {
{item = "default:apple",
response = "Hey, I really wanted an apple, thank you!"},
{item = "farming:bread",
response = "Thanks, you didn't have to, but thanks..."}
}
}, },
male = { male = {
"default:apple", phase1 = {
"farming:bread", {item = "default:apple",
"mobs:meat", response = "Hey, I really wanted an apple, thank you!"},
"default:pick_steel", {item = "farming:bread",
"default:shovel_steel", response = "Thanks, you didn't have to, but thanks..."}
"default:sword_steel" },
} phase2 = {
} {item = "farming:cotton",
response = "This is going to be very helpful, thank you!"},
-- TODO: Complete responses for female and males, both adult and child {item = "wool:wool",
npc.GIFT_RESPONSES = { response = "Thanks, you didn't have to, but thanks..."}
female = { },
{ phase3 = {
phase1 = "Thank you!", {item = "default:apple",
phase2 = "It is very appreciated! Thanks!", response = "Hey, I really wanted an apple, thank you!"},
phase3 = "Thank you! You definetely are special...", {item = "farming:bread",
phase4 = "Awww, you are so great!", response = "Thanks, you didn't have to, but thanks..."}
phase5 = "Oh, so cute! Thank you! I love you!", },
phase6 = "Thank you my dear! You are the greatest husband!" phase4 = {
}, {item = "default:apple",
{ response = "Hey, I really wanted an apple, thank you!"},
phase1 = "Thank you!", {item = "farming:bread",
phase2 = "It is very appreciated! Thanks!", response = "Thanks, you didn't have to, but thanks..."}
phase3 = "Thank you! You definetely are special...", },
phase4 = "Awww, you are so great!", phase5 = {
phase5 = "Oh, so cute! Thank you! I love you!", {item = "default:apple",
phase6 = "Thank you my dear! You are the greatest husband!" response = "Hey, I really wanted an apple, thank you!"},
}, {item = "farming:bread",
{ response = "Thanks, you didn't have to, but thanks..."}
phase1 = "Thank you!", },
phase2 = "It is very appreciated! Thanks!", phase6 = {
phase3 = "Thank you! You definetely are special...", {item = "default:apple",
phase4 = "Awww, you are so great!", response = "Hey, I really wanted an apple, thank you!"},
phase5 = "Oh, so cute! Thank you! I love you!", {item = "farming:bread",
phase6 = "Thank you my dear! You are the greatest husband!" response = "Thanks, you didn't have to, but thanks..."}
}, }
{
phase1 = "Thank you!",
phase2 = "It is very appreciated! Thanks!",
phase3 = "Thank you! You definetely are special...",
phase4 = "Awww, you are so great!",
phase5 = "Oh, so cute! Thank you! I love you!",
phase6 = "Thank you my dear! You are the greatest husband!"
},
{
phase1 = "Thank you!",
phase2 = "It is very appreciated! Thanks!",
phase3 = "Thank you! You definetely are special...",
phase4 = "Awww, you are so great!",
phase5 = "Oh, so cute! Thank you! I love you!",
phase6 = "Thank you my dear! You are the greatest husband!"
}
},
male = {
} }
} }
@ -107,6 +120,11 @@ local function get_entity_wielded_item(entity)
end end
end end
-- Function to get relationship phase
local function npc.get_relationship_phase(points)
--if (points)
end
-- Functions on right click -- Functions on right click
--------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------
@ -137,9 +155,10 @@ local function create_relationship(self, clicker_name)
local count = #self.relationships local count = #self.relationships
self.relationships[count + 1] = { self.relationships[count + 1] = {
name = clicker_name, name = clicker_name,
points = 0 points = 0,
phase = npc.RELATIONSHIP_PHASE[phase1]
} }
end end9
-- Returns a relationship points -- Returns a relationship points
local function get_relationship_points(self, clicker_name) local function get_relationship_points(self, clicker_name)