Initial commit
This commit is contained in:
65
DATA/SCRIPTS/EVALUATORS/PERSISTENTNEGATIVEINCOME.LUA
Normal file
65
DATA/SCRIPTS/EVALUATORS/PERSISTENTNEGATIVEINCOME.LUA
Normal file
@@ -0,0 +1,65 @@
|
||||
-- $Id: //depot/Projects/StarWars/Run/Data/Scripts/Evaluators/PersistentNegativeIncome.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/PersistentNegativeIncome.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(time_limit)
|
||||
|
||||
current_credits = PlayerObject.Get_Credits()
|
||||
|
||||
if not last_credits or current_credits >= last_credits then
|
||||
last_positive_income_time = GetCurrentTime()
|
||||
end
|
||||
|
||||
last_credits = current_credits
|
||||
|
||||
if (GetCurrentTime() - last_positive_income_time) > time_limit then
|
||||
return 1.0
|
||||
else
|
||||
return 0.0
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user