Cf (californium)

  • peeps
    5th Aug 2016 Member 1 Permalink

    yes it  is name "Cf"

    (sorry i have no pasetbin account so i have to paste the code here.)

    _______________________________Code_______________________________

    local Cf = elements.allocate("MOD", "CLFR")
    elements.element(elements.MOD_PT_CLFR, elements.element(elements.DEFAULT_PT_PLUT)) 
    elements.property(elements.MOD_PT_CLFR, "Name", "Cf")
    elements.property(elements.MOD_PT_CLFR, "Description", "Californium,generates neutrons with heat,exploades under extreme temperatiures.")
    elements.property(elements.MOD_PT_CLFR, "Colour", 0xFFE0452C)

    function emit(i,x,y,s,n)
    Du=math.random(100,43680)
    Db=math.random(10,1000)
    if sim.pressure(x/4,y/4)>=Db then
     k=sim.partCreate(-3, x, y, elements.DEFAULT_PT_PHOT)
     tpt.set_property("vx",math.random(-3,3),k)
     tpt.set_property("vy",math.random(-3,3),k)
     j=sim.pressure(x/4,y/4)/8.5
     if j<1 then
      tpt.set_property("ctype",0,k)
     else
     tpt.set_property("ctype",2^math.floor(j-1),k)
     end
    end
    if tpt.parts[i].temp>=Du then
     if sim.pressure(x/4,y/4)<=-10 then
     sim.partCreate(-3, x, y, elements.DEFAULT_PT_ELEC)
     else
     sim.partCreate(-3, x, y, elements.DEFAULT_PT_NEUT)
     end
    end
    if tpt.parts[i].temp>=2273.15 then
     tpt.set_property("type",elements.DEFAULT_PT_ISOZ,i)
     tpt.set_property("life",math.random(25,300),i)
    end
    if tpt.parts[i].temp<=223.15 then
     tpt.parts[i].vx=0
     tpt.parts[i].vy=0
    end
    end

    function M(i,r,g,b)
    if tpt.parts[i].temp>=100 then
     if math.random(1,25)==1 then
      return 0,0x00010015,255,r,g,b,255,r,g,b
      else
      return 0,0x00000005,255,r,g,b,0,0,0,0
     end
     else
      return 0,0x00000005,255,r,g,b,0,0,0,0
    end
    end

    function DecayExplosion(i,x,y,s,n)
    if tpt.parts[i].life>=1 then
     if tpt.parts[i].life>1 then
       if math.random(0,15)==1 then
       c=sim.partCreate(-3, x, y, elements.DEFAULT_PT_NEUT)
       d=sim.partCreate(-3, x, y, elements.DEFAULT_PT_PHOT)
       e=sim.partCreate(-3, x, y, elements.DEFAULT_PT_PROT)
       tpt.set_property("vx",math.random(-10,10),c)
       tpt.set_property("vx",math.random(-10,10),d)
       tpt.set_property("vy",math.random(-10,10),c)
       tpt.set_property("vy",math.random(-10,10),d)
       tpt.set_property("vx",math.random(-10,10),e)
       tpt.set_property("vy",math.random(-10,10),e)
       tpt.set_property("temp",10000,c)
       tpt.set_property("temp",0,d)
       tpt.set_property("temp",3500,e)
       end
      else
      sim.pressure(x/4,y/4,sim.pressure(x/4,y/4)+30)
      tpt.delete(i)
      sim.partCreate(-3, x, y, elements.DEFAULT_PT_PLSM)
     end
     tpt.parts[i].life=tpt.parts[i].life-1
    end
    end


    tpt.element_func(emit,Cf)
    tpt.graphics_func(M,Cf)
    tpt.element_func(DecayExplosion,elements.DEFAULT_PT_ISOZ)

     

    _____________________End of code__________________________

    old idea. emits neutrons undernormal temperature or hot, produce photons under pressure, colour dependent on pressure, and electrons with negative pressure.

    When over 2000 degree c it will turn into a special ISOZ Which explodes into a mixture of photons, protons and neutrons. shines with texture like minecraft lava.

  • jacob2
    5th Aug 2016 Member 1 Permalink
    You don't need a pastebin.com account to post there, lol
  • DanielGalrito
    5th Aug 2016 Member 0 Permalink

    Very nice elements! Now, time to start producing californium bombs...