clean up comments
This commit is contained in:
parent
2d9bce48e2
commit
d7c113b4ec
@ -1,7 +1,8 @@
|
|||||||
|
-- Provide petting overrides on as many mobs as possible
|
||||||
|
-- by Tai "DuCake" Kedzierski
|
||||||
|
-- Provided under LGPLv3
|
||||||
|
|
||||||
local chancer = function(hp,difficulty)
|
-- Capturing code
|
||||||
return math.floor(1000/hp * hp/(hp*0.4) * difficulty)
|
|
||||||
end
|
|
||||||
|
|
||||||
local capturedef = function(def)
|
local capturedef = function(def)
|
||||||
local handchance = chancer(def.hp,0.2)
|
local handchance = chancer(def.hp,0.2)
|
||||||
@ -21,6 +22,10 @@ local capturedef = function(def)
|
|||||||
return capturing
|
return capturing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local chancer = function(hp,difficulty)
|
||||||
|
return math.floor(1000/hp * hp/(hp*0.4) * difficulty)
|
||||||
|
end
|
||||||
|
|
||||||
local getfollows = function(followt)
|
local getfollows = function(followt)
|
||||||
if type(followt) == "string" then return followt
|
if type(followt) == "string" then return followt
|
||||||
elseif type(followt) ~= "table" then return "nothing"
|
elseif type(followt) ~= "table" then return "nothing"
|
||||||
@ -58,14 +63,6 @@ local moborder = function(self,clicker)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- table concatenation
|
-- table concatenation
|
||||||
local cattable = function(oldtable,newtable)
|
|
||||||
local targettable = {}
|
|
||||||
for i,j in pairs(oldtable) do targettable[i] = j end
|
|
||||||
for i,j in pairs(newtable) do targettable[i] = j end
|
|
||||||
return targettable
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local cattables = function(tablestable)
|
local cattables = function(tablestable)
|
||||||
local targettable = {}
|
local targettable = {}
|
||||||
for i,thetable in pairs(tablestable) do
|
for i,thetable in pairs(tablestable) do
|
||||||
@ -74,11 +71,10 @@ local cattables = function(tablestable)
|
|||||||
return targettable
|
return targettable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- geenric check function to provide
|
||||||
local nilcheck = function(oldval) return oldval ~= nil end
|
local nilcheck = function(oldval) return oldval ~= nil end
|
||||||
|
|
||||||
-- first assign capturing if necessary
|
-- A table of fighting info that can be provided generically to pubs
|
||||||
-- then assign id and order
|
|
||||||
|
|
||||||
local fighttable = {
|
local fighttable = {
|
||||||
attack_type={check=nilcheck,value="dogfight"},
|
attack_type={check=nilcheck,value="dogfight"},
|
||||||
damage={check=nilcheck,value=1}, -- small animals most likely
|
damage={check=nilcheck,value=1}, -- small animals most likely
|
||||||
@ -86,6 +82,7 @@ local fighttable = {
|
|||||||
attacks_monsters = true,
|
attacks_monsters = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- general purpose processing function
|
||||||
local function processanimals(modname,moblist,prop) -- just overrides the capturing
|
local function processanimals(modname,moblist,prop) -- just overrides the capturing
|
||||||
if prop == nil then prop = {} end
|
if prop == nil then prop = {} end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user