Re: calculate

From Sloppy Macaque, 10 Years ago, written in Lua, viewed 833 times. This paste is a reply to calculate from Crys - go back
URL https://paste.godclan.hu/view/zx_8aHQr/diff Embed
Viewing differences between calculate and Re: calculate
local hunterShootPoints = 10
local DDwin = 1
local V = 10 -- csak egy beallitas, kesobb lehet jobb lenne allitani

local avgTime = 0
local varTime = 0
 
function calledWhenRaceStarts()
    if mysql_query(handler, "SELECT COUNT(*) FROM tops WHERE this_is_this_map") == (1 or 0) then
        -- Ha 1 top van csak, nincs variancia, szal az se jo
        avgTime = 0
        varTime = 0
        return
    end
 
    local result = mysql_query(handler, "SELECT AVG(time) FROM tops WHERE this_is_this_map")
    avgTime = toNumber(result)
 
    local result = mysql_query(handler, "SELECT VAR_POP(time) FROM tops WHERE this_is_this_map")
    varTime = toNumber(result)
end

function calculatePoints(rank, pc, mode)
mode, time)
    if not pc then pc = g_playerCount end
    if not mode then mode = g_mode end
    local points
    if mode == 1 then -- Race
        if (avgTime == 0 or varTime == 0 or time < avgTime)
            points = 1
        else
            points =  exp((time - avgTim)^2 / (2 * V * varTime))
        end
    elseif mode == 2 then -- DD

        -- Gyakorlatilag atlagosan annyi pontot kap igy vki, ahany embert lokott le, ugy normalva, hogy ha nyer, kap DDwin*pc pontot. Nem mindig ad annyit, csak atlagosan nehany kor alatt elvileg. A campelokkel szemben nem mukodik, aki campel, es elfut a game elol, az tobb pontot kap igy mint amennyit megerdemel.

        points = DDwin * log2 (3*pc/(4*rank - 2))

    elseif mode == 3 then -- DM

        -- Meghalt DM-en hunter elott, itt is fuggetlenek a jatekosok, szal csak az idotol fugg a pont

        points = math.floor(pc - rank)
    elseif mode == 2 then -- DD
        points = math.floor(pc - rank)
    elseif mode == 3 then -- DM
        points = math.floor(pc - rank)
round(time/avgTime, 2)
    end
    return points
end

function calculateMoney(rank, pc, mode)
    
felvetteAHuntertDMen(time)
        
if not pc then pc = g_playerCount end
    if not mode then mode = g_mode end
    local money
    if mode 
(avgTime == 1 then 0 or varTime == 0 or time < avgTime)
            points = 1
        else
            points =  exp((time - avgTim)^2 / (2 * V * varTime))
        end
end

function lelottEgyHuntertAHunterrelDMen()
    
-- Race
        money = (pc - rank) * 250
    elseif mode == 2 then 
Le lehet loni magadat valahogy? Ha igen erdemes figyelni azt is.
    
-- DD
        money = (pc - rank) * 250
    elseif mode == 3 then 
Azert sztem ne kapjn penzt, ha hunterrel autot lo le.
    
-- DM
        money 
Be kell allitani, hogy a hunterek kozott ne lehessen a carhide-t hasznalni, nemtom most hogy van.
    points 
(pc - rank) * 250
    end
    return money
hunterShootPoints
end

Replies to Re: calculate rss

Title Name Language When
Re: Re: calculate Bistre Matamata lua 10 Years ago.

Reply to "Re: calculate"

Here you can reply to the paste above