<commit_before>/*
 * Copyright  2014 <NAME>
 * Distributed under the GNU Affero General Public License, version 3.
 * Your changes must be made public.
 * For the full license text, see LICENSE.txt.
 */
var/EventScheduler/scheduler = new()
atom/var/tmp/list/StatusEffect/LStatusEffects

atom/proc/AddStatusEffect(StatusEffect/pStatusEffect)
	if(src.LStatusEffects)
		src.LStatusEffects += pStatusEffect
	else
		src.LStatusEffects = list(pStatusEffect)

atom/proc/RemoveStatusEffect(StatusEffect/pStatusEffect)
	if(src.LStatusEffects)
		src.LStatusEffects -= pStatusEffect
		if(!LStatusEffects.len)
			LStatusEffects = null
Event
	e_StatusEffect
		var/StatusEffect/AttachedStatusEffect

		New(StatusEffect/pStatusEffect)
			//Set Event's parent to the StatusEffect
			..()
			src.AttachedStatusEffect = pStatusEffect

		fire()
			..()
			if(AttachedStatusEffect)AttachedStatusEffect.Deactivate()

	AFKCheck

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * rand(9000, 12000) + 600) // 16 to 21 minutes
				AFK_Train_Scan()

	Auction

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 43200) // 15 to 20 minutes
				auctionBidTime()

	AutoClass

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 6048000) // 1 week
				var/RandomEvent/Class/auto_class = locate() in events
				auto_class.start()

	ClanWars

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 6048000) // 1 week
				toggle_clanwars()

	Weather
		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * rand(9000, 27000)) // // 15 to 45 minutes
				var/disable = TRUE
				for(var/i in weather_effects)
					if(prob(weather_effects[i]))
						switch(i)
							if("acid")        weather.acid()
							if("snow")        weather.snow()
							if("rain")        weather.rain()
							if("cloudy")      weather.clear(75)
							if("half cloudy") weather.clear(50)
							if("sunny")       weather.clear()
						disable = FALSE
						break
				if(disable)	weather.clear(0)

	RandomizeShop
		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 6048000) // 1 week
				RandomizeShop()

	RandomEvents
		fire()
			..()
			spawn()
				if(classdest || clanwars)
					scheduler.schedule(src, world.tick_lag * rand(15000, 30000))  // 30 minutes to 1 hour

					if(classdest)
						for(var/mob/Player/p in Players)
							if(p.Gm)
								p << errormsg("<b>Automated event just skipped because class guidance is on, please turn it off if no classes are going on.</b>")
				else
					scheduler.schedule(src, world.tick_lag * rand(30000, 90000))  // 50 minutes to 2.5 hours
					for(var/RandomEvent/e in events)
						if(prob(e.chance))
							e.start()
							break


var/list/weather_effects = list("acid"        = 5,
								"snow"        = 6,
								"rain"        = 10,
								"cloudy"      = 10,
								"half cloudy" = 20,
								"sunny"       = 100)


proc
	init_events()
		scheduler.start()
		init_books()
		init_weather()
		init_random_events()
		init_auction()
<commit_msg>Reduced chances of winter weather effects<commit_after>/*
 * Copyright  2014 <NAME>
 * Distributed under the GNU Affero General Public License, version 3.
 * Your changes must be made public.
 * For the full license text, see LICENSE.txt.
 */
var/EventScheduler/scheduler = new()
atom/var/tmp/list/StatusEffect/LStatusEffects

atom/proc/AddStatusEffect(StatusEffect/pStatusEffect)
	if(src.LStatusEffects)
		src.LStatusEffects += pStatusEffect
	else
		src.LStatusEffects = list(pStatusEffect)

atom/proc/RemoveStatusEffect(StatusEffect/pStatusEffect)
	if(src.LStatusEffects)
		src.LStatusEffects -= pStatusEffect
		if(!LStatusEffects.len)
			LStatusEffects = null
Event
	e_StatusEffect
		var/StatusEffect/AttachedStatusEffect

		New(StatusEffect/pStatusEffect)
			//Set Event's parent to the StatusEffect
			..()
			src.AttachedStatusEffect = pStatusEffect

		fire()
			..()
			if(AttachedStatusEffect)AttachedStatusEffect.Deactivate()

	AFKCheck

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * rand(9000, 12000) + 600) // 16 to 21 minutes
				AFK_Train_Scan()

	Auction

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 43200) // 15 to 20 minutes
				auctionBidTime()

	AutoClass

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 6048000) // 1 week
				var/RandomEvent/Class/auto_class = locate() in events
				auto_class.start()

	ClanWars

		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 6048000) // 1 week
				toggle_clanwars()

	Weather
		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * rand(9000, 27000)) // // 15 to 45 minutes
				var/disable = TRUE
				for(var/i in weather_effects)
					if(prob(weather_effects[i]))
						switch(i)
							if("acid")        weather.acid()
							if("snow")        weather.snow()
							if("rain")        weather.rain()
							if("cloudy")      weather.clear(75)
							if("half cloudy") weather.clear(50)
							if("sunny")       weather.clear()
						disable = FALSE
						break
				if(disable)	weather.clear(0)

	RandomizeShop
		fire()
			..()
			spawn()
				scheduler.schedule(src, world.tick_lag * 6048000) // 1 week
				RandomizeShop()

	RandomEvents
		fire()
			..()
			spawn()
				if(classdest || clanwars)
					scheduler.schedule(src, world.tick_lag * rand(15000, 30000))  // 30 minutes to 1 hour

					if(classdest)
						for(var/mob/Player/p in Players)
							if(p.Gm)
								p << errormsg("<b>Automated event just skipped because class guidance is on, please turn it off if no classes are going on.</b>")
				else
					scheduler.schedule(src, world.tick_lag * rand(30000, 90000))  // 50 minutes to 2.5 hours
					for(var/RandomEvent/e in events)
						if(prob(e.chance))
							e.start()
							break


var/list/weather_effects = list("acid"        = 7,
								"snow"        = 5,
								"rain"        = 6,
								"cloudy"      = 10,
								"half cloudy" = 20,
								"sunny"       = 100)


proc
	init_events()
		scheduler.start()
		init_books()
		init_weather()
		init_random_events()
		init_auction()

{'fraction_non_alphanumeric': 0.12347287831894445, 'fraction_numerical': 0.03567356246945757, 'mean_word_length': 2.7167070217917675, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5732515', 'n_tokens_mistral': 2788, 'n_tokens_neox': 2050, 'n_words': 455}