Hello everyone. I'm writing a script that will increase the damage of certain ammunition to specific creatures.
Here's the method:
modded class ZmbM_NBC_Yellow : ZombieBase
{
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, string component, string ammo, vector modelPos)
{
if (ammo == "Bullet_357" /*|| другие условия для разных типов патронов */)
{
float currentDamage = damageResult.GetDamage(Health, "Health");
float newDamage = currentDamage * 1.5;
damageResult.SetDamage(damageType, "Health", newDamage);
}
super.EEHitBy(damageResult, damageType, source, component, ammo, modelPos);
}
}
It throws an error:
Function 'EEHitBy' is marked as override, but there is no function with this name in the base class.
But it exists in the base class: (P:\scripts\4_world\entities\creatures\infected\zombiebase.c)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
{
super.EEHitBy(damageResult, damageType, source, component, dmgZone, ammo, modelPos, speedCoef);
m_TransportHitRegistered = false;
if ( !IsAlive() )
{
ZombieHitData data = new ZombieHitData;
data.m_Component = component;
data.m_DamageZone = dmgZone;
data.m_AmmoType = ammo;
EvaluateDeathAnimationEx(source, data, m_DeathType, m_DamageHitDirection);
}
else
{
int crawlTransitionType = -1;
if ( EvaluateCrawlTransitionAnimation(source, dmgZone, ammo, crawlTransitionType) )
{
m_CrawlTransition = crawlTransitionType;
return;
}
if ( EvaluateDamageHitAnimation(source, dmgZone, ammo, m_DamageHitHeavy, m_DamageHitType, m_DamageHitDirection) )
{
if ( dmgZone )
m_ShockDamage = damageResult.GetDamage( dmgZone, "Shock" );
m_DamageHitToProcess = true;
return;
}
}
}