67 lines
2.4 KiB
Lua
67 lines
2.4 KiB
Lua
-- $Id: //depot/Projects/StarWars/Run/Data/Scripts/Evaluators/ProgressiveRandom.lua#3 $
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
--
|
|
-- (C) Petroglyph Games, Inc.
|
|
--
|
|
--
|
|
-- ***** ** * *
|
|
-- * ** * * *
|
|
-- * * * * *
|
|
-- * * * * * * * *
|
|
-- * * *** ****** * ** **** *** * * * ***** * ***
|
|
-- * ** * * * ** * ** ** * * * * ** ** ** *
|
|
-- *** ***** * * * * * * * * ** * * * *
|
|
-- * * * * * * * * * * * * * * *
|
|
-- * * * * * * * * * * ** * * * *
|
|
-- * ** * * ** * ** * * ** * * * *
|
|
-- ** **** ** * **** ***** * ** *** * *
|
|
-- * * *
|
|
-- * * *
|
|
-- * * *
|
|
-- * * * *
|
|
-- **** * *
|
|
--
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
--
|
|
-- $File: //depot/Projects/StarWars/Run/Data/Scripts/Evaluators/ProgressiveRandom.lua $
|
|
--
|
|
-- Original Author: James Yarrow
|
|
--
|
|
-- $Author: Brian_Hayes $
|
|
--
|
|
-- $Change: 25932 $
|
|
--
|
|
-- $DateTime: 2005/09/05 11:53:29 $
|
|
--
|
|
-- $Revision: #3 $
|
|
--
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
require("PGBaseDefinitions")
|
|
|
|
function Clean_Up()
|
|
-- any temporary object pointers need to be set to nil in this function.
|
|
-- ie: Target = nil
|
|
end
|
|
|
|
function Evaluate(low, high)
|
|
|
|
increment = 0.01
|
|
|
|
if not threshold then
|
|
threshold = 0.0
|
|
end
|
|
|
|
roll = GameRandom.Get_Float(low, high)
|
|
|
|
if roll < threshold then
|
|
threshold = 0.0
|
|
return 1.0
|
|
else
|
|
threshold = increment + threshold
|
|
return 0.0
|
|
end
|
|
|
|
end |