aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/core')
-rw-r--r--gamemode/core/clienteffects/cl_effects.lua1
-rw-r--r--gamemode/core/clienteffects/sv_effects.lua1
-rw-r--r--gamemode/core/combat/cl_weaponswing.lua3
-rw-r--r--gamemode/core/combat/sv_weaponswing.lua1
-rw-r--r--gamemode/core/database/sv_queries.lua1
-rw-r--r--gamemode/core/database/sv_setup.lua1
-rw-r--r--gamemode/core/dataloader/sv_loadglobals.lua3
-rw-r--r--gamemode/core/inventory/cl_invtracker.lua10
-rw-r--r--gamemode/core/inventory/common/items.lua1
-rw-r--r--gamemode/core/inventory/common/weapons.lua3
-rw-r--r--gamemode/core/inventory/inventory.lua1
-rw-r--r--gamemode/core/inventory/item.lua14
-rw-r--r--gamemode/core/inventory/sv_invtracker.lua8
-rw-r--r--gamemode/core/mapstich/sv_mapstich.lua1
-rw-r--r--gamemode/core/npc/sv_huntingspawner.lua1
-rw-r--r--gamemode/core/npc/sv_npcsystem.lua1
-rw-r--r--gamemode/core/npc/sv_shop.lua1
-rw-r--r--gamemode/core/pac/sv_pac.lua1
18 files changed, 38 insertions, 15 deletions
diff --git a/gamemode/core/clienteffects/cl_effects.lua b/gamemode/core/clienteffects/cl_effects.lua
index 60b71c1..5ae0a31 100644
--- a/gamemode/core/clienteffects/cl_effects.lua
+++ b/gamemode/core/clienteffects/cl_effects.lua
@@ -1,6 +1,7 @@
---A registry of client-side effects.
-- Use this to register effects to be called with sv_effects.lua
--@client cl_effects.lua
+--@alias er
local log = nrequire("log.lua")
local er = {} --master table of effects
diff --git a/gamemode/core/clienteffects/sv_effects.lua b/gamemode/core/clienteffects/sv_effects.lua
index 9859b95..40ae1b1 100644
--- a/gamemode/core/clienteffects/sv_effects.lua
+++ b/gamemode/core/clienteffects/sv_effects.lua
@@ -1,6 +1,7 @@
---A way to apply effects on players.
-- Also see cl_effects.lua
--@server sv_effects.lua
+--@alias ed
local ed = {}
diff --git a/gamemode/core/combat/cl_weaponswing.lua b/gamemode/core/combat/cl_weaponswing.lua
index 61c31b0..968ff9e 100644
--- a/gamemode/core/combat/cl_weaponswing.lua
+++ b/gamemode/core/combat/cl_weaponswing.lua
@@ -80,9 +80,10 @@ net.Receive("artery_doanimation",function()
end)
---Force the player to do an animation.
--- The animation must have been already registered to animbonelib ![Requires admin](./req_admin)
+-- The animation must have been already registered to animbonelib
--@usage artery_startanimation <animation name>
--@concommand artery_startanimation
+--@reqadmin
concommand.Add("artery_startanimation",function(ply,cmd,args)
if not ply:IsAdmin() then return end
swingtbl = {}
diff --git a/gamemode/core/combat/sv_weaponswing.lua b/gamemode/core/combat/sv_weaponswing.lua
index 1970007..7cac43a 100644
--- a/gamemode/core/combat/sv_weaponswing.lua
+++ b/gamemode/core/combat/sv_weaponswing.lua
@@ -1,6 +1,7 @@
---Automatically re-calculates swing arcs for weapons.
-- This files helps you create mele weapons that need to be swung
--@server sv_weaponswing.lua
+--@alias ws
--[[
This file tells you what weapons need their swings recalculated
diff --git a/gamemode/core/database/sv_queries.lua b/gamemode/core/database/sv_queries.lua
index f6f8c9f..96908d4 100644
--- a/gamemode/core/database/sv_queries.lua
+++ b/gamemode/core/database/sv_queries.lua
@@ -1,6 +1,7 @@
---Helper functions for saveing and loading players.
-- Defines functions for saveing/loading the player
--@server sv_queries.lua
+--@alias q
local fn = nrequire("utility/fn.lua")
local track = nrequire("core/inventory/sv_invtracker.lua")
diff --git a/gamemode/core/database/sv_setup.lua b/gamemode/core/database/sv_setup.lua
index 2fd0d42..dd2332d 100644
--- a/gamemode/core/database/sv_setup.lua
+++ b/gamemode/core/database/sv_setup.lua
@@ -1,6 +1,7 @@
---Functions for working the the mysqlite module.
-- Helps load players into their correct instance
--@server sv_setup.lua
+--@alias sql
--Adds the MySQLite global
nrequire("sv_mysqlite.lua")
diff --git a/gamemode/core/dataloader/sv_loadglobals.lua b/gamemode/core/dataloader/sv_loadglobals.lua
index 5a24996..84212e6 100644
--- a/gamemode/core/dataloader/sv_loadglobals.lua
+++ b/gamemode/core/dataloader/sv_loadglobals.lua
@@ -123,8 +123,9 @@ concommand.Add("artery_reloadglobals_cs",function(ply,cmd,args)
end)
---Reloads all global/ files on all clients.
--- Tells all clients to reload their client-side files, and reloads server-side files. ![Requires admin](./req_admin)
+-- Tells all clients to reload their client-side files, and reloads server-side files.
--@concommand artery_reloadglobals
+--@reqadmin
concommand.Add("artery_reloadglobals",function(ply,cmd,args)
if not ply:IsAdmin() then return end
loadglobals()
diff --git a/gamemode/core/inventory/cl_invtracker.lua b/gamemode/core/inventory/cl_invtracker.lua
index fdf5be3..e808627 100644
--- a/gamemode/core/inventory/cl_invtracker.lua
+++ b/gamemode/core/inventory/cl_invtracker.lua
@@ -1,6 +1,7 @@
---[[
- One of the tabs in the inventory
-]]
+---Keeps track of inventories on the client side.
+--@client cl_invtracker.lua
+--@alias q
+
local inv = nrequire("inventory/inventory.lua")
local itm = nrequire("item.lua")
nrequire("cl_loadglobals.lua")
@@ -11,6 +12,9 @@ local q = {}
local known_inventories = {}
local inventory_frames = {}
local invsheet
+
+---An array of all the known inventories.
+--@export
q.known_inventories = known_inventories
local drawfloatinginventory = function(id, inventory)
diff --git a/gamemode/core/inventory/common/items.lua b/gamemode/core/inventory/common/items.lua
index 4b52a97..0a32f27 100644
--- a/gamemode/core/inventory/common/items.lua
+++ b/gamemode/core/inventory/common/items.lua
@@ -1,6 +1,7 @@
---Some common functions for working with items.
-- Just one function for now
--@shared items.lua
+--@alias items
local items = {}
diff --git a/gamemode/core/inventory/common/weapons.lua b/gamemode/core/inventory/common/weapons.lua
index 065d1a6..9067981 100644
--- a/gamemode/core/inventory/common/weapons.lua
+++ b/gamemode/core/inventory/common/weapons.lua
@@ -1,6 +1,7 @@
---Common functionality used in a lot of weapons.
-- Bits an peices that most weapons need
--@shared weapons.lua
+--@alias com
local com = {}
@@ -62,7 +63,7 @@ function com.swingarc(player,times,positions,onhit)
end)
end
----Creates a new attack table
+---Creates a new attack table.
-- Creates a table of ["forward|backward|left|right"] = function()
-- This is done before hand so that table is not re-generated on the fly each time a player attacks
--@tparam attacktbl tbl_attackdata The attack data to use
diff --git a/gamemode/core/inventory/inventory.lua b/gamemode/core/inventory/inventory.lua
index 1290519..ea1d33e 100644
--- a/gamemode/core/inventory/inventory.lua
+++ b/gamemode/core/inventory/inventory.lua
@@ -1,6 +1,7 @@
---The main file needed to register create new inventory types.
-- Helps you register inventories that work with the rest of artery
--@shared inventory.lua
+--@alias inv
--[[
Public functions:
diff --git a/gamemode/core/inventory/item.lua b/gamemode/core/inventory/item.lua
index 9a6a293..79f9ad5 100644
--- a/gamemode/core/inventory/item.lua
+++ b/gamemode/core/inventory/item.lua
@@ -1,6 +1,8 @@
---The main module to use when createing new items.
-- Registers items that will work with the inventory system
--@shared item.lua
+--@alias itm
+
--[[
An itemsystem
public functions:
@@ -18,7 +20,6 @@
item:DeSerialize(string_data) ::nil
Recreate an item. If this item has any instance specific data, it should return a table.Copy(self) with the appropriate fields set.
The above must be defined for every item
- Items may also have methods from one or more interfaces registered with RegisterInterface
]]
local log = nrequire("log.lua")
@@ -31,8 +32,7 @@ local items = items or {} --Master table of all item prototypes
---Registers an item.
-- Registers an item that can be gotten later. It usually dosn't make sense for only parts of the level to have an item (the player probably can travel between all the parts of your world with the item in their inventory), therefore you should make sure items are loaded globally.
---@see itemtbl
---@tparam table tbl The table to register for the item prototype
+--@tparam itemtbl tbl The table to register for the item prototype
function itm.RegisterItem(tbl)
for k,v in pairs(required_fields) do
assert(tbl[v] ~= nil, string.format("Attempted to register item without field %q",v))
@@ -50,7 +50,7 @@ end
---Gets an instance of an item.
-- Gets an instanced copy of an item registered with RegisterItem()
--@tparam string name The name of the item
---@treturn itemtbl item The item
+--@treturn itemtbl The item
function itm.GetItemByName(name)
assert(type(name) == "string",string.format("Attempted to get an item by name with a %s.",type(name)))
assert(items[name] ~= nil,string.format("Attempted to get item with invalid name %q Valid item names are:\n\t%s",name,table.concat(table.GetKeys(items),"\n\t")))
@@ -67,6 +67,7 @@ end
-- Just gets the item, then calls DeSerialize(), returning whatever deserialize returned
--@tparam string name The name of the item
--@tparam string data The data to instantiate the item with
+--@treturn itemtbl The item that was deserialized
function itm.GetItemFromData(name,data)
assert(items[name] ~= nil,string.format("Attempted to get item with invalid name %q",name))
return items[name]:DeSerialize(data)
@@ -101,6 +102,9 @@ end
hook.Call("artery_include_items")
-concommand.Add("art_printitems",printitems)
+---Prints a list of all items the client/server knows about
+--@concommand artery_printitems
+--@usage artery_printitems
+concommand.Add("artery_printitems",printitems)
return itm
diff --git a/gamemode/core/inventory/sv_invtracker.lua b/gamemode/core/inventory/sv_invtracker.lua
index e009828..88de42e 100644
--- a/gamemode/core/inventory/sv_invtracker.lua
+++ b/gamemode/core/inventory/sv_invtracker.lua
@@ -1,8 +1,7 @@
---Utilities to help deal with inventories.
-- Helps you display, manage, and manipulate inventories
--@server sv_invtracker.lua
-
---@domain Server
+--@alias track
--[[
some accessability functions
@@ -65,7 +64,7 @@ end)
---Drops an item at the position.
-- Creates a droped item at the given position, gives the player that walks over it the item.
---@tparam itmtbl item The item to drop
+--@tparam itemtbl item The item to drop
--@tparam vector3 pos The position to drop the item
function track.DropItem(item,pos)
local e = ents.Create("art_droppeditem")
@@ -287,7 +286,6 @@ end
---Prints a player's inventory to the console.
--@concommand artery_ShowMyInventories
---@reqadmin
concommand.Add("artery_ShowMyInventories",
function(ply,cmd,args)
@@ -298,6 +296,7 @@ end)
-- Gives a new inventory to a player ![Requires admin](./req_admin)
--@usage artery_AddInventory <inventory name>
--@concommand artery_AddInventory
+--@reqadmin
concommand.Add("artery_AddInventory",function(ply,cmd,args)
if not ply:IsAdmin() then return end
track.GiveInventoryTo(ply,args[1])
@@ -307,6 +306,7 @@ end)
-- Gives a new item to the player ![Requires admin](./req_admin)
--@usage artery_GiveItem <item name>
--@concommand artery_GiveItem
+--@reqadmin
concommand.Add("artery_GiveItem",function(ply,cmd,args)
if not ply:IsAdmin() then return end
xpcall(function()
diff --git a/gamemode/core/mapstich/sv_mapstich.lua b/gamemode/core/mapstich/sv_mapstich.lua
index f8e79cd..3c5da66 100644
--- a/gamemode/core/mapstich/sv_mapstich.lua
+++ b/gamemode/core/mapstich/sv_mapstich.lua
@@ -45,6 +45,7 @@ end
---Saves the player.
-- Saves the player as if they had disconnected, or transfered to another level
--@concommand artery_saveplayer
+--@usage artery_saveplayer
concommand.Add("artery_saveplayer",function(ply,cmd,args)
SavePlayerData(ply)
end)
diff --git a/gamemode/core/npc/sv_huntingspawner.lua b/gamemode/core/npc/sv_huntingspawner.lua
index 99ed754..a9bc64c 100644
--- a/gamemode/core/npc/sv_huntingspawner.lua
+++ b/gamemode/core/npc/sv_huntingspawner.lua
@@ -1,6 +1,7 @@
---Lets huntable monsters drop loot.
-- Register what monsters drop what loot
--@server sv_huntingspawner.lua
+--@alias o
--[[
This file spawns the huntable npc's in their zones.
diff --git a/gamemode/core/npc/sv_npcsystem.lua b/gamemode/core/npc/sv_npcsystem.lua
index 0916d28..d376d6d 100644
--- a/gamemode/core/npc/sv_npcsystem.lua
+++ b/gamemode/core/npc/sv_npcsystem.lua
@@ -1,6 +1,7 @@
---Various functions for npcs.
-- Helps you spawn monsters, townies, and shopkeepers
--@server sv_npcsystem.lua
+--@alias n
local f = nrequire("concommands.lua")
local n = {}
diff --git a/gamemode/core/npc/sv_shop.lua b/gamemode/core/npc/sv_shop.lua
index fd98eb8..17d222c 100644
--- a/gamemode/core/npc/sv_shop.lua
+++ b/gamemode/core/npc/sv_shop.lua
@@ -1,5 +1,6 @@
---Some more logic related to shop npc's
--@server sv_shop.lua
+--@alias shop
local itm = nrequire("core/inventory/item.lua")
diff --git a/gamemode/core/pac/sv_pac.lua b/gamemode/core/pac/sv_pac.lua
index a4d2c00..916430c 100644
--- a/gamemode/core/pac/sv_pac.lua
+++ b/gamemode/core/pac/sv_pac.lua
@@ -2,6 +2,7 @@
--PAC3 outfits are not downloaded until they are needed, we can keep the inital download to join the server pretty small this way.
-- The downside is that the game might lag a little when someone wears something that is rare/new and everyone has to download it.
--@server sv_pac.lua
+--@alias p3
--[[
Console Commands: