function oxy_varying_init(e) end function oxy_varying_main(e) PlayerDist = GetPlayerDistance(e) if g_oxygen_leak_on == 1 and g_PlayerHealth > 0 then -- Did player get near oxygen depletion and set variable? -- -- If so decrease the oxygen levels -- g_oxystate = 1 SetSpritePosition ( g_oxygen_status , 63.5-g_oxy_dec , 4.75 ) g_oxy_dec=g_oxy_dec +.020 Prompt ("The air seems to be getting thinner. Hard to breathe.") if g_snd == 0 then StopSound(e,1) PlaySound(e,0) g_snd = 1 end end if g_oxy_dec >=30 and g_PlayerHealth >0 and g_oxygen_leak_on == 1 then g_oxy_dec = 30 g_oxystate = 0 g_oxygen_leak_on = 0 HurtPlayer(e,g_PlayerHealth) g_oxy_dec = .020 SetSpritePosition ( g_oxygen_status , 63.5-g_oxy_dec , 4.75 ) g_snd = 0 StopSound(e,0) StopSound(e,1) end if g_oxygen_leak_on == 2 then -- This will slowly increase oxygen to full level -- SetSpritePosition ( g_oxygen_status , 63.5-g_oxy_dec , 4.75 ) g_oxy_dec=g_oxy_dec -.060 Prompt("The air seems to be coming back. Getting easier to breathe.") if g_snd == 1 then StopSound(e,0) PlaySound(e,1) g_snd = 2 end end if g_oxy_dec <=.020 and g_oxygen_leak_on == 2 then g_oxy_dec =.020 g_oxystate = 0 g_oxygen_leak_on = 0 g_snd = 0 StopSound(e,0) StopSound(e,1) end end -- function