Module:Test1 module LG

From Fallen London Wiki

Documentation for this module may be created at Module:Test1 module LG/doc

local p = {}



-- test
function p.test(frame)
	local var = tonumber(frame.args[57])
	local ref = tonumber(frame.args[67])
		return (1 + var + ref)
end 

-- Watchful  ~  corresponds with frame.args[1]
-- Shadowy  ~  corresponds with frame.args[2]
-- Dangerous  ~  corresponds with frame.args[3]
-- Persuasive  ~  corresponds with frame.args[4]
-- Research Preparations  ~  corresponds with frame.args[5]
-- Laboratory Equipment  or  Eq  ~  corresponds with frame.args[6]
-- Hellworm  ~  corresponds with frame.args[7]  ~  mostly relevant when factoring in Unwise Idea
-- Number of Workers in your Laboratory  or  number_of_workers  ~  corresponds with frame.args[8]  ~  relevant when factoring in Unlikely Connection and Unexpected Result
-- A Scholar of the Correspondence  or  scholar_of_correspondence  ~  corresponds with frame.args[10]
-- A Player of Chess  ~  corresponds with frame.args[11]
-- Artisan of the Red Science  ~  corresponds with frame.args[12]
-- Glasswork  ~  corresponds with frame.args[13]
-- Kataleptic Toxicology  ~  corresponds with frame.args[14]
-- Mithridacy  ~  corresponds with frame.args[15]
-- Monstrous Anatomy  ~  corresponds with frame.args[16]
-- Shapeling Arts  ~  corresponds with frame.args[17]
-- Zeefaring  ~  corresponds with frame.args[18]

-- Current Laboratory Research or current_research  ~  corresponds with frame.args[20]
-- Total Lab Research Required or total_research_required  ~  corresponds with frame.args[21]
-- Number of on-hand Unexpected Result or on_hand_unex_res  ~  corresponds with frame.args[22]

-- FNH = [[Form New Hypotheses]]
---- Rp = [[Review the possibilities]]
function p.FNH_Rp(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local Hellworm = frame.args[7]
	local scaling_factor = math.min(prepared_watchful / 250, 1)	
	if (Hellworm == 'yes') then
		return (4/5 * scaling_factor * (Eq + 4) + 1/5 * scaling_factor * (Eq + 8 + 20) + (1 - scaling_factor) * Eq)
			/ (1  + scaling_factor * 1/5)
	else
		return (4/5 * scaling_factor * (Eq + 4) + 1/5 * scaling_factor * (Eq + 8 + 17) + (1 - scaling_factor) * Eq) 
		    / (1  + scaling_factor * 1/5)
	end
end

-- FNH = [[Form New Hypotheses]]
---- Cep = [[Consider every possibility]]
function p.FNH_Cep(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 300, 1)
	local connection_scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4) + (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (Eq + 4 + 5 * unlikely_connection_used) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 5 * (1 + connection_scaling_factor * 6/5))
		else
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5) + (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (Eq + 4 + 5 * unlikely_connection_used) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 5 * (1 + connection_scaling_factor * 6/5))
		end
end

-- RPL = [[Review the Prior Literature]]
---- Rct = [[Read the canonical texts; make pertinent notes]]
function p.RPL_Rct(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 250, 1)
	return 4/5 * scaling_factor * (Eq + 4) +
			1/5 * scaling_factor * (Eq + 8) + (1 - scaling_factor) * Eq
end

-- RPL = [[Review the Prior Literature]]
---- Cdelc = [[Chase down every last citation]]
function p.RPL_Cdelc(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local connection_scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4) + (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (Eq + 4 + 5 * unlikely_connection_used) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 5 * (1 + connection_scaling_factor * 6/5))
		else
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5) + (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (Eq + 4 + 5 * unlikely_connection_used) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 5 * (1 + connection_scaling_factor * 6/5))
		end
end

-- RPL = [[Review the Prior Literature]]
---- Gsul = [[Gather some unofficial literature]]
function p.RPL_Gsul(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 317, 1)
	local connection_scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4) + (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (2 * Eq + 5 * unlikely_connection_used) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 5 * (1 + connection_scaling_factor * 6/5))
		else
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5) + (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (2 * Eq + 5 * unlikely_connection_used) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 5 * (1 + connection_scaling_factor * 6/5))
		end
end

-- RPL = [[Review the Prior Literature]]
---- RtppE = [[Relate this problem to a past Enigma]]
function p.RPL_RtppE(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local epiphany_use = frame.args[9]
	 if (epiphany_use == 'yes') then
		return (scaling_factor * 500 + 18 + 3 * Eq + (1 - scaling_factor) * 500) / 2
	else
		return (scaling_factor * 500)
	end
end

-- ESER = [[Engage in some Empirical Research]]
---- Pcse = [[Perform a comparatively simple experiment]]
function p.ESER_Pcse(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 317, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (4/5 * (4 + Eq + unexpected_result_used) + 1/5 * (8 + Eq + 20)) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 4/5 + scaling_factor * 1/5 + (1 - scaling_factor) * 1/3)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (4/5 * (4 + Eq + unexpected_result_used) + 1/5 * (8 + Eq + 17)) + (1 - scaling_factor) * Eq)
					/ (1 + scaling_factor * 4/5 + scaling_factor * 1/5 + (1 - scaling_factor) * 1/3)
		end
end

-- ESER = [[Engage in some Empirical Research]]
---- Huasb = [[Hook up all the meters and stand well back]]
function p.ESER_Huasb(frame)
	local prepared_dangerous = (tonumber(frame.args[3]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_dangerous / 417, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * ( 12 + 2 * Eq + unexpected_result_used + 4))
					/ (1 + scaling_factor + scaling_factor * 1/5 * (1 + 1/3) + (1 - scaling_factor) * 1/3)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * ( 12 + 2 * Eq + unexpected_result_used + 17/5))
					/ (1 + scaling_factor + scaling_factor * 1/5 * 1/3 + (1 - scaling_factor) * 1/3)
		end
end

-- RYC = [[Refresh your Consumables]]
---- Wtti = [[Work through a trusted intermediary]]
function p.RYC_Wtti(frame)
	local prepared_persuasive = (tonumber(frame.args[4]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_persuasive / 250, 1)
		return  (scaling_factor * (9 + 2 * Eq) + (1 - scaling_factor) * Eq) 
				/ (1 + (1 - scaling_factor) * 1/3)
end

-- RYC = [[Refresh your Consumables]]
---- Ric = [[Rely on illicit contacts]]
function p.RYC_Ric(frame)
	local prepared_shadowy = (tonumber(frame.args[2]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_shadowy / 334, 1)
		return (scaling_factor * (4 * (Eq - 2)))
				/ (1 + (1 - scaling_factor) * 1.5/6)
end

-- RYC = [[Refresh your Consumables]]
---- Dd-Ayppyo-Awyn = [[Demand a delivery / Allow your possessions to propagate on your own / Appropriate whatever you need]]
function p.RYC_DdAyppyoAwyn(frame)
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4
				return (12 + 2 * Eq + unexpected_result_used) / 2
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5
				return (12 + 2 * Eq + unexpected_result_used) / 2
		end
end

-- ILDP = [[Invoke the Long-Dead Priests]]
---- Pr = [[Phobophagic rites]]
function p.ILDP_Pr(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local scaling_factor = math.min(prepared_watchful / 242, 1)
	local glasswork = tonumber(frame.args[13])
		return (scaling_factor * (35 / (1 + 2.718 ^ (-0.3 * (glasswork - 6)))))
end

-- DYT = [[Directing your Team]]
---- Pttwed = [[Put them to work examining data]]
function p.DYT_Pttwed(frame)
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			return (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
		else
			return (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
		end
end

-- DYT = [[Directing your Team]]
---- Gtitfu = [[Give them a line of inquiry to follow up on]]
function p.DYT_Gtitfu(frame)
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
		return (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5
end

-- DYT = [[Directing your Team]]
---- Capor_ND = [[Coordinate a plan of research (No Disgruntlement)]]
function p.DYT_Capor_ND(frame)
	local prepared_persuasive = (tonumber(frame.args[4]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_persuasive / 350, 1)
		return scaling_factor * (2 + 0.08 * Eq) * number_of_workers ^ (1 / 2) * 5 + (1 - scaling_factor) *  (6 + 1.25 * Eq)
end

-- DYT = [[Directing your Team]]
---- Capor_D = [[Coordinate a plan of research]]
function p.DYT_Capor_D(frame)
	local prepared_persuasive = (tonumber(frame.args[4]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_persuasive / 350, 1)
		return scaling_factor * (2 + 0.14 * Eq) * number_of_workers ^ (1 / 2) * 5 + (1 - scaling_factor) *  (6 + 1.25 * Eq)
end

-- DYT = [[Directing your Team]]
---- Gtdo = [[Give them a day off]]
function p.DYT_Gtdo(frame)
	local Eq = tonumber(frame.args[6])
		return 6 + 1.25 * Eq
end

-- DYT = [[Directing your Team]]
---- Tady = [[Take a day off]]
function p.DYT_Tady(frame)
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
		return (2 + 0.08 * Eq) * number_of_workers ^ (1 / 2) * 5 
end

-- E = [[Eureka!]]
---- Mapr = [[Make a profound realisation]]
function p.E_Mapr(frame)
	local Eq = tonumber(frame.args[6])
		return 18 + 3 * Eq
end

-- IYSC = [[Involve Your Secret College]]
---- WtySC = [[Write to your Secret College for help]]
function p.IYSC_WtySC(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scholar_of_correspondence = tonumber(frame.args[10])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 292, 1) * math.min(scholar_of_correspondence / 9, 1)
	local log_function_used = Eq/9 * (5 + 35 / (1 + 2.718 ^ (-0.5 * (scholar_of_correspondence - 12))))
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (log_function_used + 4/5 * unexpected_result_used + 4) + (1 - scaling_factor) * (8 + Eq))
					/ (1 + scaling_factor * ( 1 + 4/25))
	else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (log_function_used + 4/5 * unexpected_result_used + 17/5) + (1 - scaling_factor) * (8 + Eq))
					/ (1 + scaling_factor * ( 1 + 4/25) + (1 - scaling_factor) * 1/3)
		end
end

-- IYSC = [[Involve Your Secret College]]
---- Byr = [[Broaden your research]]
function p.IYSC_Byr(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 500, 1)
	local connection_scaling_factor = math.min(prepared_watchful / 367, 1)
	local log_function_used = -1 + 42 / (1 + 2.718 ^ (0.4 * (Eq - 7)))
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4) + (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (log_function_used + 4/5 * (3 * unlikely_connection_used + 18 + 3 * Eq) + 4) + (1 - scaling_factor) * (4 + Eq + 2 * unlikely_connection_used))
					/ (1 + scaling_factor * (1 + 3 * (1 + connection_scaling_factor * 6/5)) + (1 - scaling_factor) * (1 + 2 * (1 + connection_scaling_factor * 6/5)))
		else
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5)+ (1 - connection_scaling_factor) * (5 + 2 * Eq)
				return (scaling_factor * (log_function_used + 4/5 * (3 * unlikely_connection_used +  18 + 3 * Eq) + 17/5) + (1 - scaling_factor) * (4 + Eq + 2 * unlikely_connection_used))
					/ (1 + scaling_factor * (1 + 3 * (1 + connection_scaling_factor * 6/5)) + (1 - scaling_factor) * (1 + 2 * (1 + connection_scaling_factor * 6/5)))
		end
end

-- WUYF = [[Write Up Your Findings]]
---- Cdyf = [[Circulate a draft of your findings]]
function p.WUYF_Cdyf(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local current_research = tonumber(frame.args[20])
	local total_research_required = tonumber(frame.args[21])
	local on_hand_unex_res = tonumber(frame.args[22])
	local scaling_factor = math.min(prepared_watchful / 334, 1)	
		return (scaling_factor * (100 * math.min(current_research / total_research_required, 1) + 10 * (on_hand_unex_res ^ (9/10 + total_research_required /200000)))) 
			/ (1  + (1 - scaling_factor) * 1/3)
end

-- WUYF = [[Write Up Your Findings]]
---- Oyn = [[Organise your notes]]
function p.WUYF_Oyn(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]) + tonumber(frame.args[22]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 334, 1)
	local log_function_used = -1 + 42 / (1 + 2.718 ^ (0.4 * (Eq - 7)))
		return (scaling_factor * (log_function_used + 18 + 3 * Eq))
			/ 2
end

-- ROOS = [[Running out of Steam]]
---- Gfw = [[Go for a walk]]
function p.ROOS_Gfw(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local connection_scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4)
				return (2 * (18 + 3 * Eq) + 20 + 3 * (5 + 2 * Eq) + 5 * unlikely_connection_used)
					/ (3 + 5 * (1 + connection_scaling_factor * 6/5))
		else
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5)
				return (2 * (18 + 3 * Eq) + 17 + 3 * (5 + 2 * Eq) + 5 * unlikely_connection_used)
					/ (3 + 5 * (1 + connection_scaling_factor * 6/5))
		end
end

-- ROOS = [[Running out of Steam]]
---- Bapot = [[Brew another pot of tea]]
function p.ROOS_Bapot(frame)
	local Eq = tonumber(frame.args[6])
				return (5 + 2 * Eq)
end

-- ROOS = [[Running out of Steam]]
---- Taes = [[Take an extended sabbatical]]
function p.ROOS_Taes(frame)
	local Eq = tonumber(frame.args[6])
				return (43 + 5 * Eq)
					/ 2
end

-- ROOT = [[Running out of Terms]]
---- Paaots = [[Pull another alphabet off the shelf]]
function p.ROOT_Paaots(frame)
	local Eq = tonumber(frame.args[6])
				return 8 + Eq
end

-- ROOT = [[Running out of Terms]]
---- CGaL = [[Combine Greek and Latin]]
function p.ROOT_CGaL(frame)
	local Eq = tonumber(frame.args[6])
				return (18 + 3 * Eq)
					/ (7/6)
end

-- ROYA = [[Rely on your (Assistant)]]
---- Swthato = [[See whether (they) have anything to offer (General Option for assistants)]]
function p.ROYA_Swhhato(frame)
	local Eq = tonumber(frame.args[6])
				return (5/3 * Eq)
end

-- ROYA = [[Rely on your (Assistant)]]
---- Atpeinw = [[Apply (their) particular expertise in a novel way (General Option for assistants)]]
function p.ROYA_Atpeinw(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			return  (scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4) + (1 - scaling_factor) * (5 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		else
			return (scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5) + (1 - scaling_factor) * (5 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		end
end

-- ROYA = [[Rely on your (Assistant)]]
---- Rotk = [[Rely on (their) knowledge]]
function p.ROYA_Rotk(frame)
	local Eq = tonumber(frame.args[6])
				return (26 + 9/2 * Eq)
					/ 2
end

-- ROYES = [[Rely on your Esurient Smith]]
---- HhcwL = [[Have him collaborate with Lettice]]
function p.ROYES_HhcwL(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (30 + 5 * Eq + unexpected_result_used) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 11/5)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (30 + 5 * Eq + unexpected_result_used) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 11/5)
		end
end

-- ROYA = [[Rely on your (Assistant)]]
---- HtstPS = [[Have (them) supervise the Profound Student]]
function p.ROYA_HtstPS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (12 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (12 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		end
end

-- ROFFG = [[Rely on F.F. Gebrandt]]
---- LFFGeyPS = [[Let F.F. Gebrandt employ your Profound Student]]
function p.ROFFG_LFFGeyPS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (10 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (10 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (10 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (10 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		end
end

-- ROA = [[Rely on April]]
---- HhaLwt = [[Have her and Lettice work together]]
function p.ROA_HhaLwt(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
				return (scaling_factor * (12 + 2 * Eq) + (1 - scaling_factor) * (8 + 2 * Eq))
end

-- ROYA = [[Rely on your (Assistant)]]
---- HyAsyVS = [[Have (your Assistant) supervise your Visionary Student]]
function p.ROYA_HyAsyVS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (12 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (10 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (12 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (10 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		end
end

-- ROYA = [[Rely on your (Assistant)]]
---- Atthwsr = [[Ask (them) to help with special research]]
function p.ROYA_Atthwsr(frame)
	local Eq = tonumber(frame.args[6])
				return (22 + 5 * Eq)
					/ 2
end

-- RON = [[Rely on Numismatrix]]
---- Ahthwur = [[Ask her to help with unusual research]]
function p.RON_Ahthwur(frame)
	local prepared_persuasive = (tonumber(frame.args[4]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_persuasive / 334, 1)
				return (scaling_factor * (22 + 5 * Eq) + (1 - scaling_factor) * (5/3 * Eq)) 
					/ (1 + scaling_factor)
end

-- ROL = [[Rely on Lettice]]
---- HhstGS = [[Have her supervise the Gifted Student]]
function p.ROL_HhstGS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (12 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (5 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (12 + 2 * Eq + unexpected_result_used) + (1 - scaling_factor) * (5 + 2 * Eq))
					/ (1 + scaling_factor * 6/5)
		end
end

-- WWYSS = [[Work with your Shifty Student]]
---- WwySS = [[Work with your (Shifty) Student]]
function p.WWYSS_WwySS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 342, 1)
				return scaling_factor * (2 * Eq + 1/5) + (1 - scaling_factor) * (4/3 * Eq)
end

-- WWYSS = [[Work with your Shifty Student]]
---- EySstwwhc = [[Encourage your (Shifty) student to work with his colleagues]]
function p.WWYSS_EySstwwhc(frame)
	local number_of_workers = tonumber(frame.args[8])
	local prepared_persuasive = (tonumber(frame.args[4]) + tonumber(frame.args[5]))
	local scaling_factor = math.min(prepared_persuasive / 359, 1)
				return scaling_factor * (11/5 * (number_of_workers + 5)) + (1 - scaling_factor) * (number_of_workers + 5)
end

-- WWYMS = [[Work with your Meticulous Student]]
---- WwyMS = [[Work with your (Meticulous) student]]
function p.WWYMS_WwyMS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
				return scaling_factor * (5 + 2 * Eq) + (1 - scaling_factor) * (2 + Eq)
end

-- WWYMS = [[Work with your Meticulous Student]]
---- FuahwyMS = [[Follow up a hunch with your (Meticulous) student]]
function p.WWYMS_FuahwyMS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (18 + 3 * Eq + unexpected_result_used / 5) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 26/25)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (18 + 3 * Eq + unexpected_result_used / 5) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 26/25)
		end
end

-- WWYMS = [[Work with your Meticulous Student]]
---- Ehhitsd = [[Employ her help in tabulating some data]]
function p.WWYMS_Ehhitsd(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
				return (scaling_factor * (8 + 2 * Eq + 4) + (1 - scaling_factor) * (4 + Eq))
					/ (1 + scaling_factor * 1/5)
		else
				return (scaling_factor * (8 + 2 * Eq + 17/5) + (1 - scaling_factor) * (4 + Eq))
					/ (1 + scaling_factor * 1/5)
		end
end

-- WWYGS = [[Work with your Gifted Student]]
---- WwyGS = [[Work with your (Gifted) student]]
function p.WWYGS_WwyGS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local connection_scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 4)
				return (scaling_factor * (6 + 2 * Eq + unlikely_connection_used) + (1 - scaling_factor) * (3 + 5/3 * Eq))
					/ (1 + scaling_factor * (1 + connection_scaling_factor * 6/5))
		else
			local unlikely_connection_used = connection_scaling_factor * (7 + 2 * Eq + (2 + 0.2 * Eq) * number_of_workers ^ (1/2) * 5 + 17/5)
				return (scaling_factor * (6 + 2 * Eq + unlikely_connection_used) + (1 - scaling_factor) * (3 + 5/3 * Eq))
					/ (1 + scaling_factor * (1 + connection_scaling_factor * 6/5))
		end
end

-- WWYGS = [[Work with your Gifted Student]]
---- FuahwyGS = [[Follow up a hunch with your (Gifted) student]]
function p.WWYGS_FuahwyGS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (18 + 3 * Eq + unexpected_result_used / 2) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 7/10)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (18 + 3 * Eq + unexpected_result_used / 2) + (1 - scaling_factor) * (8 + 2 * Eq))
					/ (1 + scaling_factor * 7/10)
		end
end			

-- WWYPS = [[Work with your Profound Student]]
---- WwyePS = [[Work with your expert (Profound) student]]
function p.WWYPS_WwyePS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
				return (scaling_factor * (42/5 + 2 * Eq) + (1 - scaling_factor) * (6 + 7/4 * Eq))
end

-- WWYPS = [[Work with your Profound Student]]
---- FuahwyPS = [[Follow up a hunch with your (Profound) student]]
function p.WWYPS_FuahwyPS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
				return (scaling_factor * (18 + 3 * Eq + 4) + (1 - scaling_factor) * (26 + 5 * Eq))
				/ (1 + scaling_factor * 1/5 + (1 - scaling_factor)) 
		else
				return (scaling_factor * (18 + 3 * Eq + 17/5) + (1 - scaling_factor) * (26 + 5 * Eq))
				/ (1 + scaling_factor * 1/5 + (1 - scaling_factor)) 
		end
end

-- WWYVS = [[Work with your Visionary Student]]
---- WwyeVS = [[Work with your expert (Visionary) student]]
function p.WWYVS_WwyeVS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
				return (scaling_factor * (46/5 + 2 * Eq) + (1 - scaling_factor) * (13/2 + 8/4 * Eq))
end

-- WWYVS = [[Work with your Visionary Student]]
---- FuahwyVS = [[Follow up a hunch with your (Visionary) student]]
function p.WWYVS_FuahwyVS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
				return (scaling_factor * (18 + 3 * Eq + 4) + (1 - scaling_factor) * (8 + 2 * Eq))
				/ (1 + scaling_factor * 1/5) 
		else
				return (scaling_factor * (18 + 3 * Eq + 17/5) + (1 - scaling_factor) * (8 + 2 * Eq))
				/ (1 + scaling_factor * 1/5) 
		end
end

-- WWYVS = [[Work with your Visionary Student]]
---- LyVSttod = [[Leave your (Visionary) student to their own devices]]
function p.WWYVS_LyVSttod(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local number_of_workers = tonumber(frame.args[8])
	local connection_scaling_factor = math.min(prepared_watchful / 367, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
			local unlikely_connection_used = connection_scaling_factor * (7 + unexpected_result_used)
				return (unexpected_result_used + unlikely_connection_used/4 + 5 + unexpected_result_used/4)
					/ (1 + (3 + connection_scaling_factor * 6/5)/4)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
			local unlikely_connection_used = connection_scaling_factor * (7 + unexpected_result_used)
				return (unexpected_result_used + unlikely_connection_used/4 + 17/4 + unexpected_result_used/4)
					/ (1 + (3 + connection_scaling_factor * 6/5)/4)
		end
end

-- DoyKoRS = [[Draw on your Knowledge of the Red Science]]
---- Fat = [[Formulate a theory]]
function p.DoyKoRS_Fat(frame)
	local Eq = tonumber(frame.args[6])
	local red_artisan = tonumber(frame.args[12])
	local scaling_factor = math.min(red_artisan / 9, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (red_artisan - 6)))
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
				return (scaling_factor * (log_function_used + 4) + (1 - scaling_factor) * (Eq))
				/ (1 + 1/5 + 2/15 + (1 - scaling_factor) * (2/3))
		else
				return (scaling_factor * (log_function_used + 17/5) + (1 - scaling_factor) * (Eq))
				/ (1 + 1/5 + 2/15 + (1 - scaling_factor) * (2/3))
		end
end

-- DoyKoRS = [[Draw on your Knowledge of the Red Science]]
---- Rap = [[Resolve a paradox]]
function p.DoyKoRS_Rap(frame)
	local Eq = tonumber(frame.args[6])
	local red_artisan = tonumber(frame.args[12])
	local scaling_factor = math.min(red_artisan / 10, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (red_artisan - 6)))
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
				return (scaling_factor * (log_function_used + 4) + (1 - scaling_factor) * (Eq))
				/ (1 + 1/5 + 1/5 + (1 - scaling_factor))
		else
				return (scaling_factor * (log_function_used + 17/5) + (1 - scaling_factor) * (Eq))
				/ (1 + 1/5 + 1/5 + (1 - scaling_factor))
		end
end

-- DoyKoRS = [[Draw on your Knowledge of the Red Science]]
---- CyIT = [[Contemplate your Impossible Theorem]]
function p.DoyKoRS_CyIT(frame)
	local Eq = tonumber(frame.args[6])
	local red_artisan = tonumber(frame.args[12])
	local scaling_factor = math.min(red_artisan / 8, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (red_artisan - 6)))
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
				return (scaling_factor * (log_function_used + 4) + (1 - scaling_factor) * (16.5 / (1 + 2.718 ^ (-0.4 * (red_artisan - 6)))))
				/ (1 + 1/5 + 7/30)
		else
				return (scaling_factor * (log_function_used + 17/5) + (1 - scaling_factor) * (16.5 / (1 + 2.718 ^ (-0.4 * (red_artisan - 6)))))
				/ (1 + 1/5 + 7/30)
		end
end

-- DoyKoRS = [[Draw on your Knowledge of the Red Science]]
---- CyEoD = [[Contemplate your Element of Dawn]]
function p.DoyKoRS_CyEoD(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + 3 * tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local red_artisan = tonumber(frame.args[12])
	local scaling_factor = math.min(red_artisan / 10, 1) * math.min(prepared_watchful / 384, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (red_artisan - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (16.5 / (1 + 2.718 ^ (-0.4 * (red_artisan - 6)))))
				/ (1 + 7/30)
end

-- DoyKoRS = [[Draw on your Knowledge of the Red Science]]
---- SRtBfaSoRS = [[Study / Recall the Blueprint for a Seal of Red Science]]
function p.DoyKoRS_SRtBfaSoRS(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + 3 * tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local red_artisan = tonumber(frame.args[12])
	local scaling_factor = math.min(red_artisan / 10, 1) * math.min(prepared_watchful / 384, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (red_artisan - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (16.5 / (1 + 2.718 ^ (-0.4 * (red_artisan - 6)))))
end

-- DoyKoSA = [[Draw on your Knowledge of the Shapeling Arts]]
---- ErsfFC = [[Extract regretful shapes from a Fluke-Core]]
function p.DoyKoSA_ErsfFC(frame)
	local Eq = tonumber(frame.args[6])
	local kataleptic_toxicology = tonumber(frame.args[14])
	local shapeling_arts = tonumber(frame.args[17])
	local scaling_factor = math.min(kataleptic_toxicology / 8, 1) * math.min(shapeling_arts / 9, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (shapeling_arts - 6)))
				return (scaling_factor * (log_function_used + 18 + 3 * Eq) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (shapeling_arts - 7)))))
				/ (1 + scaling_factor + (1 - scaling_factor) * 1/3)
end

-- DoyKoSA = [[Draw on your Knowledge of the Shapeling Arts]]
---- Moyps = [[Meditate on your present shape]]
function p.DoyKoSA_Moyps(frame)
	local prepared_watchful = (tonumber(frame.args[1]) + tonumber(frame.args[5]))
	local Eq = tonumber(frame.args[6])
	local shapeling_arts = tonumber(frame.args[17])
	local scaling_factor = math.min(shapeling_arts / 10, 1) * math.min(prepared_watchful / 367, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (shapeling_arts - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (shapeling_arts - 7)))))
end

-- DoyKoSA = [[Draw on your Knowledge of the Shapeling Arts]]
---- Eadf = [[Explore a divergent form]]
function p.DoyKoSA_Eadf(frame)
	local prepared_dangerous = tonumber(frame.args[3])
	local Eq = tonumber(frame.args[6])
	local shapeling_arts = tonumber(frame.args[17])
	local scaling_factor = math.min(shapeling_arts / 10, 1) * math.min(prepared_dangerous / 300, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (shapeling_arts - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (shapeling_arts - 7)))))
end

-- DoyKoP = [[Draw on your Knowledge of Poisons]]
---- Dy = [[Dose yourself]]
function p.DoyKoP_Dy(frame)
	local kataleptic_toxicology = tonumber(frame.args[14])
	local scaling_factor = math.min(kataleptic_toxicology / 10, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 7)))))
end

-- DoyKoP = [[Draw on your Knowledge of Poisons]]
---- Uttsiyv = [[Understand the toxins swimming in your veins]]
function p.DoyKoP_Uttsiyv(frame)
	local Eq = tonumber(frame.args[6])
	local kataleptic_toxicology = tonumber(frame.args[14])
	local scaling_factor = math.min(kataleptic_toxicology / 8, 1)
	local log_function_used = 35 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 7)))))
end

-- DoyKoP = [[Draw on your Knowledge of Poisons]]
---- UyCVitpos = [[Use your Cantigaster Venom in the process of studying]]
function p.DoyKoP_UyCVitpos(frame)
	local Eq = tonumber(frame.args[6])
	local kataleptic_toxicology = tonumber(frame.args[14])
	local scaling_factor = math.min(kataleptic_toxicology / 8, 1)
	local log_function_used = 2 + 35 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 6)))
				return (scaling_factor * (log_function_used + 18 + 3 * Eq) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 7)))))
				/ (1 + scaling_factor)
end

-- DoyKoP = [[Draw on your Knowledge of Poisons]]
---- Dse = [[Dose somebody else]]
function p.DoyKoP_Dse(frame)
	local kataleptic_toxicology = tonumber(frame.args[14])
	local scaling_factor = math.min(kataleptic_toxicology / 8, 1)
	local log_function_used = 2 + 35 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 7)))))
end

-- DoyKoM = [[Draw on your Knowledge of Monsters]]
---- Ayuom = [[Apply your understanding of monsters]]
function p.DoyKoM_Ayuom(frame)
	local monstrous_anatomy = tonumber(frame.args[16])
	local scaling_factor = math.min(monstrous_anatomy / 8, 1)
	local log_function_used = 2 + 35 / (1 + 2.718 ^ (-0.3 * (monstrous_anatomy - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (monstrous_anatomy - 7)))))
				
end

-- DoyKoM = [[Draw on your Knowledge of Monsters]]
---- Mowim = [[Meditate on what it means to be monstrous]]
function p.DoyKoM_Mowim(frame)
	local Eq = tonumber(frame.args[6])
	local monstrous_anatomy = tonumber(frame.args[16])
	local log_function_used = 2 + 35 / (1 + 2.718 ^ (-0.3 * (monstrous_anatomy - 6)))
				return (log_function_used + 18 + 3 * Eq)
				/ 2
end


-- DoyKoM = [[Draw on your Knowledge of Monsters]]
---- FyASas = [[Feed your Acute Squirrel a sample]]
function p.DoyKoP_FyASas(frame)
	local kataleptic_toxicology = tonumber(frame.args[14])
	local scaling_factor = math.min(kataleptic_toxicology / 10, 1)
	local log_function_used = 2 + 35 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (40 / (1 + 2.718 ^ (-0.3 * (kataleptic_toxicology - 7)))))
end

-- Doynk = [[Draw on your nautical knowledge]]
---- Eypcal = [[Examine your past charts and logs]]
function p.Doynk_Eypcal(frame)
	local Eq = tonumber(frame.args[6])
	local zeefaring = tonumber(frame.args[18])
	local scaling_factor = math.min(zeefaring / 10, 1)
	local log_function_used = 2 + 35 / (1 + 2.718 ^ (-0.3 * (zeefaring - 6)))
				return (scaling_factor * (log_function_used) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (zeefaring - 7)))))
end

-- Doynk = [[Draw on your nautical knowledge]]
---- GhfH = [[Get help from Hephaesta]]
function p.Doynk_GhfH(frame)
	local Eq = tonumber(frame.args[6])
	local zeefaring = tonumber(frame.args[18])
	local number_of_workers = tonumber(frame.args[8])
	local scaling_factor = math.min(zeefaring / 9, 1)
	local Hellworm = frame.args[7]
		if (Hellworm == 'yes') then
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 4
				return (scaling_factor * (30 + 5 * Eq + unexpected_result_used) + (1 - scaling_factor) * (5 + 2 * Eq))
					/ (1 + scaling_factor * 11/5)
		else
			local unexpected_result_used = (2 + 0.2 * Eq) * number_of_workers ^ (1 / 2) * 5 + 17/5
				return (scaling_factor * (30 + 5 * Eq + unexpected_result_used) + (1 - scaling_factor) * (5 + 2 * Eq))
					/ (1 + scaling_factor * 11/5)
		end
end

-- Doynk = [[Draw on your nautical knowledge]]
---- GhfH = [[Recall a recent zee-voyage]]
function p.Doynk_GhfH(frame)
	local Eq = tonumber(frame.args[6])
	local zeefaring = tonumber(frame.args[18])
	local scaling_factor = math.min(zeefaring / 10, 1)
	local log_function_used = 2 + 35 / (1 + 2.718 ^ (-0.3 * (zeefaring - 6)))
				return (scaling_factor * (log_function_used + 18 + 3 * Eq) + (1 - scaling_factor) * (20 / (1 + 2.718 ^ (-0.3 * (zeefaring - 7)))))
				/ (1 + scaling_factor)
end

return p