用户:Sandbox2017

来自物理沙盘百科
跳转至: 导航搜索

元素说明 用户:Sandbox2017/沙箱 用户:Sandbox2017/沙箱/运算符优先级

"\bw" = 255 255 255   white
"\bg" = 192 192 192   gray
"\bo" = 255 216  32   orange
"\br" = 255   0   0   red
"\bl" = 255  75  75   light-red
"\bb" =   0   0 255   blue
"\bt" =  32 170 255   light-blue
"\bp" = 100  10 100   purple (Jacob1's mod)
local radon = elem.allocate("MOD", "RADON")
local radium = elem.allocate("MOD", "RADIUM")
 
elem.element(radon, elem.element(elem.DEFAULT_PT_NBLE))
elem.property(radon, "Name", "RADN")
elem.property(radon, "Description", "Radon gas.")
-- elem.property(radon, "Colour", 你自己填写吧)
elem.property(radon, "MenuSection", elem.SC_NUCLEAR)
elem.property(radon, "Properties", bit.bor(elem.property(radon, "Properties"), elem.PROP_RADIOACTIVE + elem.PROP_NEUTPENETRATE))
elem.property(radon, "Update", function (i,x,y,ss,nt)
	local np
	if math.random(1,1000) == 1 then
		np = sim.partCreate(-1, x + math.random(-1,1), y + math.random(-1,1), elem.DEFAULT_PT_NEUT)
		sim.partProperty(np, sim.FIELD_TEMP, sim.partProperty(i, sim.FIELD_TEMP) + 20)
		sim.partChangeType(i, elem.DEFAULT_PT_POLO)
	end
end)
 
elem.element(radium, elem.element(elem.DEFAULT_PT_STNE))
elem.property(radium, "Name", "RADM")
elem.property(radium, "Description", "Radium, decays into radon gas.")
elem.property(radium, "Colour", 0xA098A0)
elem.property(radium, "MenuSection", elem.SC_NUCLEAR)
elem.property(radium, "Properties", bit.bor(elem.property(radium, "Properties"), elem.PROP_RADIOACTIVE + elem.PROP_NEUTPENETRATE))
elem.property(radium, "Update", function (i,x,y,ss,nt)
	local np
	if math.random(1,50000) == 1 then
		np = sim.partCreate(-3, x + math.random(-1,1), y + math.random(-1,1), elem.DEFAULT_PT_NEUT)
		if np >= 0 then
			sim.partProperty(np, sim.FIELD_TEMP, sim.partProperty(i, sim.FIELD_TEMP) + 20)
			sim.partChangeType(i, radon)
		end
	end
end)