<commit_before>-- LTE fr das Druidensystem
-- by Falk
require("base.common")
require("druid.base.outfit")

module("druid.lte.id_167_illness", package.seeall) --(druid.base.outfit))

-- INSERT INTO longtimeeffects VALUES (167, 'druids_illness', 'druid.lte.id_167_illness');

-- function for Effect_1
function CreateManaCloud(event_position)
world:gfx(4,event_position)
end

function ManaIllnessEffects(User, coughProb, strongCoughProb, sneezProb, snotProb)
    -- coughing, sneezing, snot fot Effect_1
	if (User:increaseAttrib("sex",0) == 1) then 
	    pronoun_DE = "ihr"
		pronoun_EN = "her"
	else 
	    pronoun_DE = "sein"
		pronoun_EN = "his"
	end	
	local probRandom = math.random(1,100) 
	local FieldFrontOfChar = base.commom.GetFrontPosition(User)
	
	if (probRandom <= coughProb) and (coughProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#me hustet eine blaue Wolke aus.")
		User:talkLanguage(Character.say,Player.english,"#me coughs a blue cloud out.")
		world:gfx(4,FieldFrontOfChar)
		User:increaseAttrib("mana",-250)
    elseif (probRandom > coughProb) and (probRandom <= (coughProb + strongCoughProb)) and (strongCoughProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#me hustet lautstark eine groe, blaue Wolke aus, die sich um "..pronoun_DE.."en Kopf herum verteilt.")
		User:talkLanguage(Character.say,Player.english,"#me coughs vociferously a big, blue cloud out which disperses around "..pronoun_EN.." head.")
		base.common.CreateCircle(User.pos, 1, CreateManaCloud)
		User:increaseAttrib("mana",-500)   
    elseif (probRandom > (coughProb + strongCoughProb)) and (probRandom <= (coughProb + strongCoughProb + sneezProb)) and (sneezProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#me niest und eine Strahl von Manawolken entfleucht sein"..pronoun_DE.." Nase.")
		User:talkLanguage(Character.say,Player.english,"#me coughs vociferously a big, blue cloud out which disperses around "..pronoun_EN.." head.")
		base.common.CreateLine(FieldFrontOfChar, TargetPos, CreateManaCloud)
		User:increaseAttrib("mana",-500)
    elseif (probRandom > (coughProb + strongCoughProb + sneezProb)) and (probRandom <= (coughProb + strongCoughProb + sneezProb + snotProb)) and (snotProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#mes Nase entkommt ein blulicher Faden Schleim und tropft auf den Boden.")
		User:talkLanguage(Character.say,Player.english,"#me's nose looses a blusih strand of snot which drops to the ground.")
		world:gfx(11,FieldFrontOfChar)
		User:increaseAttrib("mana",-100)
	end
	
end

function Effect_1(Effect,User)
    -- mana illness 
	-- cough/snot/sneezing which reduces mana
	-- maixmum mana capacity is lowered
	
	findIllnessStatus,illness_status = Effect:findValue("illness_status");
    findHealing,healing_status = Effect:findValue("healing_status"); -- == 1 -> char is getting better :-)  ~= 1 -> char is ill and getting worse :-(
	
	if findIllnessStatus then
	    
		if illnes_status <= 9 then -- first phase of the illness; so actually effect, just an inform
            
			if not (healing_status == 1) and (illnes_status == 3) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Dir scheint als fhlst Du etwas Pelziges auf Deiner Zunge. Pltzlich sprst Du einen kurzen Stich in Deiner Brust, der schnell wieder nachlsst.",
               "It seems to you as if you feel something furry on your tongue. Suddenly, you feel briefly a stitch in your chest, which fades away, fastly.");
	        end
	        if (healing_status == 1) and (illnes_status == 7) then -- this inform is if you are sick, but you become better! Only one time.
	            base.common.InformNLS( User,
               "Der Husten scheint gnzlich abgeklungen zu sein. Nur das penetrante Gefhl von etwas Pelzigem ruht noch auf Deiner Zunge.",
               "The coughs has faded away finally, it seems. Only the penetrative feeling of something flurry stays on your tongue.");
	        end
	
	    end 
		
		if (illnes_status >= 10) and (illness_status <= 19) then -- second phase of the illness; a new inform and the first real effects
		    
			if not (healing_status == 1) and (illnes_status == 10) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Das pelzige Gefhl auf Deiner Zunge nimmt zu und irgendwas fhlt sich in Deinem Krper komisch an. Nach einem Kratzen im Hals musst Du husten und ein Teil Deines Manas verlsst Dich.",
               "The furry feeling on yout tongue intensiefies and something feels strange in your body. After a having a short sore throat you have to cough and some of your mana leavse you.");
	           ManaIllnessEffects(User, 100, 0, 0, 0)
			end
	        if (healing_status == 1) and (illnes_status == 19) then -- this inform is if you are sick, but you become better! Only one time.
	            base.common.InformNLS( User,
               "Der Husten wird schwcher und auch Deinem Hals geht es langsam besser, obwohl er noch etwas kratzt. Auerdem scheint <NAME> wieder die gewohnte Menge an Mana aufnehmen zu knnen.",
               "The coughs is getting weaker and also your throat feels better, even if it is still a bit sore. Also, your body seems to be able to hold the usual amount of mana.");
	        end
	        
			-- and here is the effect which can happen every round
			if not (illness_status == 10) then	
				ManaIllnessEffects(User, 10, 0, 0, 0)
		    end
		
		end

        if (illnes_status >= 20) and (illness_status <= 29)	then -- third phase of the illness	
		    
			-- mana reducing to a determined value; check every round
			if ( User:increaseAttrib("mana",0) > 7500 ) then
			    User:setAttrib("mana",7500)
			end	
			
			if not (healing_status == 1) and (illnes_status == 20) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Der Husten wird strker. Das Kratzen im Hals ist nun dauerhaft da und Deine Brust schmerzt. <NAME> scheint nicht mehr in der Lage, die gewohnte Menge an Mana dauerhaft halten zuknnen.",
               "The cough is getting stronger. Your throat is now permanently sore and your chest hurts. Your body seems no longer to able to hold lastingly the usualy amount of mana.");
	           ManaIllnessEffects(User, 0, 100, 0, 0)
			end
	        if (healing_status == 1) and (illnes_status == 29) then -- this inform is if you are sick, but you become better! Only one time.
	            base.common.InformNLS( User,
               "Schnupfen und Niesen scheinen verschwunden. Brust und Hals schmerzen noch immer, doch Dein Krper scheint wieder etwas mehr - wenn auch immer noch weniger als gewhnlich - Mana aufnehmen zu knnen.",
               "Snuffle and sneezing seem to be gone. Chest and thorat still ache, but your body seems to be able to hold more - even if still not the usual amount - mana.");
	        end
	        
			-- and here is the effect which can happen every round
			if not (illnes_status == 20) then	
				ManaIllnessEffects(User, 10, 5, 0, 0)
		    end
		
		end
		
		if (illnes_status >= 30) and (illness_status <= 39)	then -- fourth phase of the illness	
	
	        -- mana reducing to a determined value; check every round
			if ( User:increaseAttrib("mana",0) > 5000 ) then
			    User:setAttrib("mana",5000)
			end	
			
			if not (healing_status == 1) and (illnes_status == 30) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Schnupfen und Niesen gesellen sich zu Deinem Husten. Die maixmale Manakonzentration in Deinem Krper sinkt nunmehr auf die Hlfte.",
               "Snuffels and sneezing join the coughing. The maximal mana concentration of your body falls henceforth to the half.");
	           ManaIllnessEffects(User, 0, 0, 100, 0)
			end
	        
			-- and here is the effect which can happen every round
			if not (illnes_status == 20) then	
				ManaIllnessEffects(User, 10, 5, 5, 15)
			end
		end
		
    else User:inform("LTE error: Lte 167, Error 1, inform a dev, please.");
		 return;
	end
end	
	    

function getAction(User,Effect,Runde) -- here, we check what illness the char has and we call the fitting effect
	findEffectValue,effect_value = Effect:findValue("effect_value");   
	<commit_msg>illness stuff<commit_after>-- LTE fr das Druidensystem
-- by Falk
require("base.common")
require("druid.base.outfit")

module("druid.lte.id_167_illness", package.seeall) --(druid.base.outfit))

-- INSERT INTO longtimeeffects VALUES (167, 'druids_illness', 'druid.lte.id_167_illness');

-- function for Effect_1
function CreateManaCloud(event_position)
world:gfx(4,event_position)
end

function ManaIllnessEffects(User, coughProb, strongCoughProb, sneezProb, snotProb)
    -- coughing, sneezing, snot fot Effect_1
	if (User:increaseAttrib("sex",0) == 1) then 
	    pronoun_DE = "ihr"
		pronoun_EN = "her"
	else 
	    pronoun_DE = "sein"
		pronoun_EN = "his"
	end	
	local probRandom = math.random(1,100) 
	local FieldFrontOfChar = base.commom.GetFrontPosition(User, 1)
	local Field5FieldsOfChar = base.commom.GetFrontPosition(User, 5)
	
	if (probRandom <= coughProb) and (coughProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#me hustet eine blaue Wolke aus.")
		User:talkLanguage(Character.say,Player.english,"#me coughs a blue cloud out.")
		world:gfx(4,FieldFrontOfChar)
		User:increaseAttrib("mana",-250)
    elseif (probRandom > coughProb) and (probRandom <= (coughProb + strongCoughProb)) and (strongCoughProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#me hustet lautstark eine groe, blaue Wolke aus, die sich um "..pronoun_DE.."en Kopf herum verteilt.")
		User:talkLanguage(Character.say,Player.english,"#me coughs vociferously a big, blue cloud out which disperses around "..pronoun_EN.." head.")
		base.common.CreateCircle(User.pos, 1, CreateManaCloud)
		User:increaseAttrib("mana",-500)   
    elseif (probRandom > (coughProb + strongCoughProb)) and (probRandom <= (coughProb + strongCoughProb + sneezProb)) and (sneezProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#me niest und eine Strahl von Manawolken entfleucht sein"..pronoun_DE.." Nase.")
		User:talkLanguage(Character.say,Player.english,"#me coughs vociferously a big, blue cloud out which disperses around "..pronoun_EN.." head.")
		base.common.CreateLine(FieldFrontOfChar, Field5FieldsOfChar, CreateManaCloud)
		User:increaseAttrib("mana",-500)
    elseif (probRandom > (coughProb + strongCoughProb + sneezProb)) and (probRandom <= (coughProb + strongCoughProb + sneezProb + snotProb)) and (snotProb ~= 0) then
	    User:talkLanguage(Character.say,Player.german,"#mes Nase entkommt ein blulicher Faden Schleim und tropft auf den Boden.")
		User:talkLanguage(Character.say,Player.english,"#me's nose looses a blusih strand of snot which drops to the ground.")
		world:gfx(11,FieldFrontOfChar)
		User:increaseAttrib("mana",-100)
	end
	
end

function Effect_1(Effect,User)
    -- mana illness 
	-- cough/snot/sneezing which reduces mana
	-- maixmum mana capacity is lowered
	
	findIllnessStatus,illness_status = Effect:findValue("illness_status");
    findPersistence,persistence = Effect:findValue("persistence"); -- == 1 -> char is getting better :-)  ~= 1 -> char is ill and getting worse :-(
	
	if findIllnessStatus then
	    
		if illnes_status <= 9 then -- first phase of the illness; so actually effect, just an inform
            
			if not (persistence == 0) and (illnes_status == 3) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Dir scheint als fhlst Du etwas Pelziges auf Deiner Zunge. Pltzlich sprst Du einen kurzen Stich in Deiner Brust, der schnell wieder nachlsst.",
               "It seems to you as if you feel something furry on your tongue. Suddenly, you feel briefly a stitch in your chest, which fades away, fastly.");
	        end
	        if (persistence == 0) and (illnes_status == 7) then -- this inform is if you are sick, but you become better! Only one time.
	            base.common.InformNLS( User,
               "Der Husten scheint gnzlich abgeklungen zu sein. Nur das penetrante Gefhl von etwas Pelzigem ruht noch auf Deiner Zunge.",
               "The coughs has faded away finally, it seems. Only the penetrative feeling of something flurry stays on your tongue.");
	        end
	
	    end 
		
		if (illnes_status >= 10) and (illness_status <= 19) then -- second phase of the illness; a new inform and the first real effects
		    
			if not (persistence == 0) and (illnes_status == 10) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Das pelzige Gefhl auf Deiner Zunge nimmt zu und irgendwas fhlt sich in Deinem Krper komisch an. Nach einem Kratzen im Hals musst Du husten und ein Teil Deines Manas verlsst Dich.",
               "The furry feeling on yout tongue intensiefies and something feels strange in your body. After a having a short sore throat you have to cough and some of your mana leavse you.");
	           ManaIllnessEffects(User, 100, 0, 0, 0)
			end
	        if (persistence == 0) and (illnes_status == 19) then -- this inform is if you are sick, but you become better! Only one time.
	            base.common.InformNLS( User,
               "Der Husten wird schwcher und auch Deinem Hals geht es langsam besser, obwohl er noch etwas kratzt. Auerdem scheint Dein Krper wieder die gewohnte Menge an Mana aufnehmen zu knnen.",
               "The coughs is getting weaker and also your throat feels better, even if it is still a bit sore. Also, your body seems to be able to hold the usual amount of mana.");
	        end
	        
			-- and here is the effect which can happen every round
			if not (illness_status == 10) then	
				ManaIllnessEffects(User, 10, 0, 0, 0)
		    end
		
		end

        if (illnes_status >= 20) and (illness_status <= 29)	then -- third phase of the illness	
		    
			-- mana reducing to a determined value; check every round
			if ( User:increaseAttrib("mana",0) > 7500 ) then
			    User:setAttrib("mana",7500)
			end	
			
			if not (persistence == 0) and (illnes_status == 20) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Der Husten wird strker. Das Kratzen im Hals ist nun dauerhaft da und Deine Brust schmerzt. <NAME> scheint nicht mehr in der Lage, die gewohnte Menge an Mana dauerhaft halten zuknnen.",
               "The cough is getting stronger. Your throat is now permanently sore and your chest hurts. Your body seems no longer to able to hold lastingly the usualy amount of mana.");
	           ManaIllnessEffects(User, 0, 100, 0, 0)
			end
	        if (persistence == 0) and (illnes_status == 29) then -- this inform is if you are sick, but you become better! Only one time.
	            base.common.InformNLS( User,
               "Schnupfen und Niesen scheinen verschwunden. Brust und Hals schmerzen noch immer, doch <NAME> scheint wieder etwas mehr - wenn auch immer noch weniger als gewhnlich - Mana aufnehmen zu knnen.",
               "Snuffle and sneezing seem to be gone. Chest and thorat still ache, but your body seems to be able to hold more - even if still not the usual amount - mana.");
	        end
	        
			-- and here is the effect which can happen every round
			if not (illnes_status == 20) then	
				ManaIllnessEffects(User, 10, 5, 0, 0)
		    end
		
		end
		
		if (illnes_status >= 30) and (illness_status <= 39)	then -- fourth phase of the illness	
	
	        -- mana reducing to a determined value; check every round
			if ( User:increaseAttrib("mana",0) > 5000 ) then
			    User:setAttrib("mana",5000)
			end	
			
			if not (persistence == 0) and (illnes_status == 30) then -- this inform is only given if you become sick and only once; not while getting better
               base.common.InformNLS( User,
               "Schnupfen und Niesen gesellen sich zu Deinem Husten. Die maixmale Manakonzentration in Deinem Krper sinkt nunmehr auf die Hlfte.",
               "Snuffels and sneezing join the coughing. The maximal mana concentration of your body falls henceforth to the half.");
	           ManaIllnessEffects(User, 0, 0, 100, 0)
			end
	        
			-- and here is the effect which can happen every round
			if not (illnes_status == 20) then	
				ManaIllnessEffects(User, 10, 5, 5, 15)
			end
		end
		
		if not (persistence == 0) then
		
    
	
	
	else User:inform("LTE error: Lte 167, Error 1, inform a dev, please.");
		 return;
	end
end	
	    

function getAction(User,Effect,Runde) -- here, we check what illness the char has and we call the fitting effect
	findEffectValue,effect_value = Effect:findValue("effect_value");   
	
{'fraction_non_alphanumeric': 0.08566423357664234, 'fraction_numerical': 0.016058394160583942, 'mean_word_length': 3.1872860635696822, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, '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': '3801519', 'n_tokens_mistral': 5794, 'n_tokens_neox': 5226, 'n_words': 1991}