<commit_before>//I will need to recode parts of this but I am way too tired atm
/obj/effect/blob
	name = "blob"
	icon = 'blob.dmi'
	icon_state = "blob"
	desc = "Some blob creature thingy"
	density = 0
	opacity = 0
	anchored = 1
	var
		active = 1
		health = 30
		brute_resist = 4
		fire_resist = 1
		blobtype = "Blob"
		blobdebug = 0
		/*Types
		Blob
		Node
		Core
		Factory
		Shield
		*/


	New(loc, var/h = 30)
		blobs += src
		active_blobs += src
		src.health = h
		src.dir = pick(1,2,4,8)
		src.update()
		..(loc)


	Del()
		blobs -= src
		if(active)
			active_blobs -= src
		if((blobtype == "Node") || (blobtype == "Core"))
			processing_objects.Remove(src)
		..()


	CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
		if((air_group && blobtype != "Shield") || (height==0))	return 1
		if(istype(mover) && mover.checkpass(PASSBLOB))	return 1
		return 0


	proc/check_mutations()//These could be their own objects I guess
		if(blobtype != "Blob")	return
		//Spaceeeeeeblobbb
		if((istype(src.loc, /turf/space)) || (blobdebug == 4))
			active = 0
			health = min(health*2, 100)
			brute_resist = 1
			fire_resist = 2
			name = "strong blob"
			icon_state = "blob_idle"//needs a new sprite
			blobtype = "Shield"
			active_blobs -= src
			return 1
		//Commandblob
		if((blobdebug == 1))
			active = 0
			health = min(health*4, 200)
			brute_resist = 2
			fire_resist = 2
			name = "blob core"
			icon_state = "blob_core"
			blobtype = "Core"
			active_blobs -= src
			processing_objects.Add(src)
			return 1
		//Nodeblob
		if((blobdebug == 2))
			active = 0
			health = min(health*3, 150)
			brute_resist = 1
			fire_resist = 2
			name = "blob node"
			icon_state = "blob_node"//needs a new sprite
			blobtype = "Node"
			active_blobs -= src
			processing_objects.Add(src)
			return 1
		if((blobdebug == 3))
			health = min(health*2, 100)
			name = "porous blob"
			icon_state = "blob_factory"//needs a new sprite
			blobtype = "Factory"
			return 1
		return 0


	process()
		spawn(-1)
			Life()
		return


	proc/Pulse(var/pulse = 0, var/origin_dir = 0)//Todo: Fix spaceblob expand
		set background = 1
		if((blobtype != "Node") && (blobtype != "Core"))//This is so bad
			if(special_action())//If we can do something here then we dont need to pulse more
				return
			if(check_mutations())
				return

		if((blobtype == "Blob") && (pulse <= 2) && (prob(30)))
			blobdebug = 4
			check_mutations()
			return

		if(pulse > 20)	return//Inf loop check
		//Looking for another blob to pulse
		var/list/dirs = list(1,2,4,8)
		dirs.Remove(origin_dir)//Dont pulse the guy who pulsed us
		for(var/i = 1 to 4)
			if(!dirs.len)	break
			var/dirn = pick(dirs)
			dirs.Remove(dirn)
			var/turf/T = get_step(src, dirn)
			var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
			if(!B)
				expand(T)//No blob here so try and expand
				return
			B.Pulse((pulse+1),get_dir(src.loc,T))
			return
		return


	proc/special_action()
		set background = 1
		switch(blobtype)
			if("Factory")
				new/obj/effect/critter/blob(src.loc)
				return 1
			if("Core")
				spawn(0)
					Pulse(0,1)
					Pulse(0,2)
					Pulse(0,4)
					Pulse(0,8)
				return 1
			if("Node")
				spawn(0)
					Pulse(0,0)
				return 1
			if("Blob")
				if(expand())
					return 1
		return 0


	proc/Life()
		if(check_mutations())
			return 1
		if(special_action())
			return 1
		return 0


	proc/expand(var/turf/T = null)
		if(!prob(health))	return//TODO: Change this to prob(health + o2 mols or such)
		if(!T)
			var/list/dirs = list(1,2,4,8)
			for(var/i = 1 to 4)
				var/dirn = pick(dirs)
				dirs.Remove(dirn)
				T = get_step(src, dirn)
				if((locate(/obj/effect/blob) in T))
					T = null
					continue
				else 	break
		if(T)
			var/obj/effect/blob/B = new /obj/effect/blob(src.loc, min(src.health, 30))
			if(T.Enter(B,src))
				B.loc = T
			else
				T.blob_act()
				del(B)<commit_msg>Made the blob take damage from fire.<commit_after>//I will need to recode parts of this but I am way too tired atm
/obj/effect/blob
	name = "blob"
	icon = 'blob.dmi'
	icon_state = "blob"
	desc = "Some blob creature thingy"
	density = 0
	opacity = 0
	anchored = 1
	var
		active = 1
		health = 30
		brute_resist = 4
		fire_resist = 1
		blobtype = "Blob"
		blobdebug = 0
		/*Types
		Blob
		Node
		Core
		Factory
		Shield
		*/


	New(loc, var/h = 30)
		blobs += src
		active_blobs += src
		src.health = h
		src.dir = pick(1,2,4,8)
		src.update()
		..(loc)


	Del()
		blobs -= src
		if(active)
			active_blobs -= src
		if((blobtype == "Node") || (blobtype == "Core"))
			processing_objects.Remove(src)
		..()


	CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
		if((air_group && blobtype != "Shield") || (height==0))	return 1
		if(istype(mover) && mover.checkpass(PASSBLOB))	return 1
		return 0


	proc/check_mutations()//These could be their own objects I guess
		if(blobtype != "Blob")	return
		//Spaceeeeeeblobbb
		if((istype(src.loc, /turf/space)) || (blobdebug == 4))
			active = 0
			health = min(health*2, 100)
			brute_resist = 1
			fire_resist = 2
			name = "strong blob"
			icon_state = "blob_idle"//needs a new sprite
			blobtype = "Shield"
			active_blobs -= src
			return 1
		//Commandblob
		if((blobdebug == 1))
			active = 0
			health = min(health*4, 200)
			brute_resist = 2
			fire_resist = 2
			name = "blob core"
			icon_state = "blob_core"
			blobtype = "Core"
			active_blobs -= src
			processing_objects.Add(src)
			return 1
		//Nodeblob
		if((blobdebug == 2))
			active = 0
			health = min(health*3, 150)
			brute_resist = 1
			fire_resist = 2
			name = "blob node"
			icon_state = "blob_node"//needs a new sprite
			blobtype = "Node"
			active_blobs -= src
			processing_objects.Add(src)
			return 1
		if((blobdebug == 3))
			health = min(health*2, 100)
			name = "porous blob"
			icon_state = "blob_factory"//needs a new sprite
			blobtype = "Factory"
			return 1
		return 0


	process()
		spawn(-1)
			Life()
		return


	proc/Pulse(var/pulse = 0, var/origin_dir = 0)//Todo: Fix spaceblob expand
		set background = 1
		if((blobtype != "Node") && (blobtype != "Core"))//This is so bad
			if(special_action())//If we can do something here then we dont need to pulse more
				return
			if(check_mutations())
				return

		if((blobtype == "Blob") && (pulse <= 2) && (prob(30)))
			blobdebug = 4
			check_mutations()
			return

		if(pulse > 20)	return//Inf loop check
		//Looking for another blob to pulse
		var/list/dirs = list(1,2,4,8)
		dirs.Remove(origin_dir)//Dont pulse the guy who pulsed us
		for(var/i = 1 to 4)
			if(!dirs.len)	break
			var/dirn = pick(dirs)
			dirs.Remove(dirn)
			var/turf/T = get_step(src, dirn)
			var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
			if(!B)
				expand(T)//No blob here so try and expand
				return
			B.Pulse((pulse+1),get_dir(src.loc,T))
			return
		return


	proc/special_action()
		set background = 1
		switch(blobtype)
			if("Factory")
				new/obj/effect/critter/blob(src.loc)
				return 1
			if("Core")
				spawn(0)
					Pulse(0,1)
					Pulse(0,2)
					Pulse(0,4)
					Pulse(0,8)
				return 1
			if("Node")
				spawn(0)
					Pulse(0,0)
				return 1
			if("Blob")
				if(expand())
					return 1
		return 0


	proc/Life()
		if(check_mutations())
			return 1
		if(special_action())
			return 1

		return 0

	temperature_expose(datum/gas_mixture/air, temperature, volume)
		if(temperature > T0C+200)
			health -= 0.01 * temperature
	proc/expand(var/turf/T = null)
		if(!prob(health))	return//TODO: Change this to prob(health + o2 mols or such)
		if(!T)
			var/list/dirs = list(1,2,4,8)
			for(var/i = 1 to 4)
				var/dirn = pick(dirs)
				dirs.Remove(dirn)
				T = get_step(src, dirn)
				if((locate(/obj/effect/blob) in T))
					T = null
					continue
				else 	break
		if(T)
			var/obj/effect/blob/B = new /obj/effect/blob(src.loc, min(src.health, 30))
			if(T.Enter(B,src))
				B.loc = T
			else
				T.blob_act()
				del(B)
{'fraction_non_alphanumeric': 0.14133333333333334, 'fraction_numerical': 0.026793650793650793, 'mean_word_length': 2.7810849735957754, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6700876', 'n_tokens_mistral': 3805, 'n_tokens_neox': 3055, 'n_words': 767}