[Moeng-cvs] CaveAdventure/data/scripts Lang.lua,NONE,1.1 Spring.lua,NONE,1.1
Status: Alpha
Brought to you by:
b_lindeijer
From: <b_l...@us...> - 2004-01-13 19:21:43
|
Update of /cvsroot/moeng/CaveAdventure/data/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv29271 Added Files: Lang.lua Spring.lua Log Message: Would these work? --- NEW FILE: Lang.lua --- -- -- Contains all the stuff that is being said in the game -- By Bjorn Lindeijer -- -- This object holds written text, to easy translation of the game. Variables -- starting with a 'c' are conversations. -- import("Object.lua") Lang = Object:subclass { name = "Lang"; getConv = function(self, convName) local conv = self.convs[convName] if (conv) then -- Replace variables return conv else m_message("Warning: no such conversation ("..convName..")") return {} end end; getVar = function(self, varName) local var = self.vars[varName] if (var) then return var else m_message("Warning: no such variable ("..varName..")") return "" end end; vars = {}; convs = {}; } --- NEW FILE: Spring.lua --- -- -- The spring by Frode -- import("Decoration.lua") import("Animation.lua") import("lang.lua") Spring = Decoration:subclass { name = "Spring"; activatedBy = function(self, instigator) Decoration.activatedBy(self, instigator) if (instigator.health < instigator.maxHealth) then ActionController:addSequence({ ActionTweenVariable(instigator, "health", 2*(instigator.maxHealth - instigator.health), instigator.maxHealth), }) end end; defaultproperties = { animType = LinearAnimation, animSeq = extr_array(m_get_bitmap("spring.bmp"), 48, 72), animSpeed = 1 / 8, w = 2, h = 1, bCanActivate = true, bCenterOnTile = false, bCenterBitmap = false, convTableKeyword = "Refreshing", }; } |