Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Sign in to follow this  
Verum

Рана

Собственно вопрос. Думаю многим будет интересено.
В скрипте "удары от зомби" прописано, что при ударе с шансом, даёт рану. При этом с шансом даёт заразу... Но, проблема в том, что заразу даёт вне зависимости, повесил ли зомби рану или нет.. Можете подсказать, что не так...
 

	override void ProcessHit(float damage, EntityAI source, int component, string zone, string ammo, vector modelPos)
	{
		float dmg_max = m_Player.GetMaxHealth(zone, "Blood");
		float dmg = damage;
		float bleed_threshold = GetGame().ConfigGetFloat( "CfgAmmo " + ammo + " DamageApplied " + "bleedThreshold" );
		bool is_source_animal = false;
		bool is_source_wildanimal = false;


		bleed_threshold = Math.Clamp(bleed_threshold,0,1);

		foreach(string animal : m_InfectedAnimals)
		{
			if (source.IsKindOf(animal))
			{
				is_source_animal = true;
				break;
			}
		}

		foreach(string wildanimal : m_WildAnimals)
		{
			if (source.IsKindOf(wildanimal))
			{
				is_source_wildanimal = true;
				break;
			}
		}
		if (source.IsZombie())
		{
			float chance = (float)MAGlobals.Get().g_ZombieBleedChance / 100;
			if (Math.RandomFloat01() < chance)
			{
				AttemptAddBleedingSource(component);
				if (Math.RandomFloat01() < 0.40)
				{
					m_Player.InsertAgent(eAgents.WOUND_AGENT, 100);
				}

				if (Math.RandomFloat01() < 0.05)
				{
					m_Player.InsertAgent(eAgents.BRAIN, 20);
				}

				if (Math.RandomFloat01() < 0.40)
				{
					m_Player.InsertAgent(RE_Agents.RAGEVIRUS, 20);
				}
			}
		}

		else if (is_source_animal)
		{
			float chance1 = 0.5;
			if (Math.RandomFloat01() < chance1)
			{
				AttemptAddBleedingSource(component);
				if (Math.RandomFloat01() < 0.30)
				{
					m_Player.InsertAgent(RE_Agents.RAGEVIRUS, 20);
				}

				if (Math.RandomFloat01() < 0.10)
				{
					m_Player.InsertAgent(eAgents.BRAIN, 20);
				}
			}
		}
	}

 

Edited by Verum (see edit history)

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.