From e2428796b9afe019ae6ca45e07fbe1aaa6963917 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 23 Mar 2018 20:20:40 -0400 Subject: Started working on quest inventory --- gamemode/questsystem/component_gather.lua | 25 +++++++++++++++++++++++++ gamemode/questsystem/component_kill.lua | 3 +++ gamemode/questsystem/component_talk.lua | 3 +++ 3 files changed, 31 insertions(+) create mode 100644 gamemode/questsystem/component_gather.lua create mode 100644 gamemode/questsystem/component_kill.lua create mode 100644 gamemode/questsystem/component_talk.lua (limited to 'gamemode/questsystem') diff --git a/gamemode/questsystem/component_gather.lua b/gamemode/questsystem/component_gather.lua new file mode 100644 index 0000000..fccb32a --- /dev/null +++ b/gamemode/questsystem/component_gather.lua @@ -0,0 +1,25 @@ +local comp = {} + +comp.Name = "Quest Component Gather" + + +function comp:Init(itemname,itemnumber) + self.itemname = itemname + self.itemnumber = itemnumber +end + +function comp:GetText() + return string.format("Gather %s %s",self.itemnumber,self.itiemname) +end + +function comp:Serialize() + return util.TableToJSON({itemname,itemnumber}) +end + +function comp:DeSerialize(data) + local tbl = util.JSONToTable(data) + self.itemname = tbl[1] + self.itemnumber = tbl[2] +end + +nrequire("core/quests/quest.lua").RegisterArc(comp) diff --git a/gamemode/questsystem/component_kill.lua b/gamemode/questsystem/component_kill.lua new file mode 100644 index 0000000..3925a12 --- /dev/null +++ b/gamemode/questsystem/component_kill.lua @@ -0,0 +1,3 @@ +--[[ +Something to stop gmod from freaking out +]] diff --git a/gamemode/questsystem/component_talk.lua b/gamemode/questsystem/component_talk.lua new file mode 100644 index 0000000..3925a12 --- /dev/null +++ b/gamemode/questsystem/component_talk.lua @@ -0,0 +1,3 @@ +--[[ +Something to stop gmod from freaking out +]] -- cgit v1.2.3-70-g09d2