local datasrv = lgs.DataSrv
local propsrv = lgs.PropertySrv

local function randomCard()
	local number = datasrv.RandInt(0,9)
	local result = "obj/txt16/blcbook.bmp"
	if number > 0 then
		result = "obj/txt16/Card" .. tostring(number) .. ".bmp"
	end
	return result
end

function Sim(msg)
  print('>>>Sim')
  if msg.fStarting then
	if not propsrv.Possessed(script.objid,'OTxtRepr0') then
		propsrv.Set(script.objid,'OTxtRepr0',randomCard())
	end
	if not propsrv.Possessed(script.objid,'OTxtRepr1') then
		propsrv.Set(script.objid,'OTxtRepr1',randomCard())
	end
	if not propsrv.Possessed(script.objid,'OTxtRepr2') then
		propsrv.Set(script.objid,'OTxtRepr2',randomCard())
	end
	if not propsrv.Possessed(script.objid,'OTxtRepr3') then
		propsrv.Set(script.objid,'OTxtRepr3',randomCard())
	end
  end
  print('<<<Sim')
  return true
end

