Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/Entities/EntityZombieSDX.cs
Nathaniel Cosford e06f2bd282 Add All Mods
2025-05-29 23:33:28 +09:30

2378 lines
121 KiB
C#

using Audio;
using System.Collections.Generic;
using System.Globalization;
public class EntityZombieSDX : EntityZombie
{
public override void SetEntityName(string _name)
{
if (_name.Equals(this.entityName))
return;
string randomName = RebirthUtilities.GetRandomName(this);
if (!string.IsNullOrEmpty(randomName))
{
_name = randomName;
}
this.entityName = _name;
this.bPlayerStatsChanged |= !this.isEntityRemote;
}
public override void Write(BinaryWriter _bw, bool bNetworkWrite)
{
base.Write(_bw, bNetworkWrite);
Buffs.Write(_bw);
_bw.Write(otherTags);
_bw.Write(lootDropEntityClass);
_bw.Write(wanderingHorde);
}
public override void Read(byte _version, BinaryReader _br)
{
base.Read(_version, _br);
try
{
Buffs.Read(_br);
}
catch { }
try
{
this.otherTags = _br.ReadString();
}
catch
{
this.otherTags = "";
}
try
{
this.lootDropEntityClass = _br.ReadString();
}
catch
{
this.lootDropEntityClass = "";
}
try
{
this.wanderingHorde = _br.ReadInt32();
}
catch
{
this.wanderingHorde = 0;
}
}
/*public override Vector3i dropCorpseBlock()
{
if (this.lootContainer != null && this.lootContainer.IsUserAccessing())
return Vector3i.zero;
Vector3i _blockPos = base.dropCorpseBlock();
if (_blockPos == Vector3i.zero || !(this.world.GetTileEntity(0, _blockPos) is TileEntityLootContainer tileEntity))
return Vector3i.zero;
if (this.lootContainer != null)
{
tileEntity.CopyLootContainerDataFromOther(this.lootContainer);
}
else
{
if (RebirthUtilities.IsHordeNight())
{
this.lootListOnDeath = "";
}
tileEntity.lootListName = this.lootListOnDeath;
tileEntity.SetContainerSize(LootContainer.GetLootContainer(this.lootListOnDeath).size, true);
}
tileEntity.SetModified();
return _blockPos;
}*/
public override void dropItemOnDeath()
{
//Log.Out("EntityZombieSDX-dropItemOnDeath START");
for (int i = 0; i < this.inventory.GetItemCount(); i++)
{
ItemStack item = this.inventory.GetItem(i);
ItemClass forId = ItemClass.GetForId(item.itemValue.type);
if (forId != null && forId.CanDrop())
{
this.world.GetGameManager().ItemDropServer(item, this.position, new Vector3(0.5f, 0f, 0.5f), -1, Constants.cItemDroppedOnDeathLifetime, false);
this.inventory.SetItem(i, ItemValue.None.Clone(), 0, true);
}
}
this.inventory.SetFlashlight(false);
this.equipment.DropItems();
if (this.world.IsDark())
{
this.lootDropProb *= 1f;
}
if (this.entityThatKilledMe)
{
this.lootDropProb = EffectManager.GetValue(PassiveEffects.LootDropProb, this.entityThatKilledMe.inventory.holdingItemItemValue, this.lootDropProb, this.entityThatKilledMe, null, new FastTags<TagGroup.Global>(), true, true, true, true, true, 1, false);
}
if (RebirthUtilities.IsHordeNight())
{
//Log.Out($"EntityZombieSDX-dropItemOnDeath BEFORE ({this.entityName}) this.lootDropProb: {this.lootDropProb}");
if (RebirthUtilities.ScenarioSkip())
{
string biomeName = RebirthUtilities.GetBiomeName(this);
int biomeID = 0;
if (biomeName != "")
{
biomeID = RebirthUtilities.GetBiomeID(biomeName);
}
this.lootDropProb = RebirthVariables.hiveLootbagDrop + RebirthUtilities.LootDropChance(biomeID);
}
else
{
if (!this.HasAnyTags(FastTags<TagGroup.Global>.Parse("NoLootDropChange")))
{
float customHordeNightLootDropMultiplier = 3 * float.Parse(RebirthVariables.customHordeNightLootDropMultiplier) / 100;
//Log.Out("EntityZombieSDX-dropItemOnDeath customHordeNightLootDropMultiplier: " + customHordeNightLootDropMultiplier);
if (this.lootDropProb >= 1f)
{
customHordeNightLootDropMultiplier = 1f;
//Log.Out("EntityZombieSDX-dropItemOnDeath ADJUST customHordeNightLootDropMultiplier: " + customHordeNightLootDropMultiplier);
}
if (this.HasAnyTags(FastTags<TagGroup.Global>.Parse("reducedHNloot")))
{
this.lootDropProb = this.lootDropProb * 0.25f * customHordeNightLootDropMultiplier;
//Log.Out("EntityZombieSDX-dropItemOnDeath REDUCED this.lootDropProb: " + this.lootDropProb);
}
else
{
this.lootDropProb = this.lootDropProb * 1f * customHordeNightLootDropMultiplier;
//Log.Out("EntityZombieSDX-dropItemOnDeath AFTER this.lootDropProb: " + this.lootDropProb);
}
}
}
}
else
{
//Log.Out("EntityZombieSDX-dropItemOnDeath this.wanderingHorde: " + this.wanderingHorde);
if (RebirthUtilities.ScenarioSkip() && this.wanderingHorde == 1)
{
string biomeName = RebirthUtilities.GetBiomeName(this);
int biomeID = 0;
if (biomeName != "")
{
biomeID = RebirthUtilities.GetBiomeID(biomeName);
}
this.lootDropProb = RebirthVariables.hiveLootbagDrop + RebirthUtilities.LootDropChance(biomeID);
}
else
{
if (this.lootDropProb < 1f && !(this.Buffs.GetCustomVar("$herdEntity") == 1f))
{
this.lootDropProb = 0;
}
}
}
if (this.Buffs.GetCustomVar("$varFuriousRamsayBoss") == 1f)
{
this.lootDropProb = 1;
}
//Log.Out("EntityZombieSDX-dropItemOnDeath this.lootDropProb: " + this.lootDropProb);
if (this.lootDropProb > this.rand.RandomFloat)
{
//Log.Out("EntityZombieSDX-dropItemOnDeath this.EntityTags: " + this.EntityTags);
if (!RebirthVariables.customEventsLoot && this.HasAnyTags(FastTags<TagGroup.Global>.Parse("seeker,boss")))
{
//Log.Out("EntityZombieSDX-dropItemOnDeath A");
}
else
{
//Log.Out("EntityZombieSDX-dropItemOnDeath B");
GameManager.Instance.DropContentOfLootContainerServer(BlockValue.Air, new Vector3i(this.position), this.entityId);
}
}
}
private float GetDamageFraction(float _damage)
{
return _damage / (float)this.GetMaxHealth();
}
public override DamageResponse damageEntityLocal(DamageSource _damageSource, int _strength, bool _criticalHit, float impulseScale)
{
DamageResponse damageResponse = default(DamageResponse);
damageResponse.Source = _damageSource;
damageResponse.Strength = _strength;
damageResponse.Critical = _criticalHit;
damageResponse.HitDirection = Utils.EnumHitDirection.None;
damageResponse.MovementState = this.MovementState;
damageResponse.Random = this.rand.RandomFloat;
damageResponse.ImpulseScale = impulseScale;
damageResponse.HitBodyPart = _damageSource.GetEntityDamageBodyPart(this);
damageResponse.ArmorSlot = _damageSource.GetEntityDamageEquipmentSlot(this);
damageResponse.ArmorSlotGroup = _damageSource.GetEntityDamageEquipmentSlotGroup(this);
if (_strength > 0)
{
damageResponse.HitDirection = (_damageSource.Equals(DamageSource.fall) ? Utils.EnumHitDirection.Back : ((Utils.EnumHitDirection)Utils.Get4HitDirectionAsInt(_damageSource.getDirection(), this.GetLookVector())));
}
if (!GameManager.IsDedicatedServer && _damageSource.damageSource != EnumDamageSource.Internal && GameManager.Instance != null)
{
World world = GameManager.Instance.World;
if (world != null && _damageSource.getEntityId() == world.GetPrimaryPlayerId())
{
Transform hitTransform = this.emodel.GetHitTransform(_damageSource);
Vector3 position;
if (hitTransform)
{
position = hitTransform.position;
}
else
{
position = this.emodel.transform.position;
}
bool flag = world.GetPrimaryPlayer().inventory.holdingItem.HasAnyTags(FastTags<TagGroup.Global>.Parse("ranged"));
float magnitude = (world.GetPrimaryPlayer().GetPosition() - position).magnitude;
if (flag && magnitude > EntityAlive.HitSoundDistance)
{
Manager.PlayInsidePlayerHead("HitEntitySound", -1, 0f, false);
}
if (EntityAlive.ShowDebugDisplayHit)
{
Transform transform = hitTransform ? hitTransform : this.emodel.transform;
Vector3 position2 = Camera.main.transform.position;
DebugLines.CreateAttached("EntityDamage" + this.entityId.ToString(), transform, position2 + Origin.position, _damageSource.getHitTransformPosition(), new Color(0.3f, 0f, 0.3f), new Color(1f, 0f, 1f), EntityAlive.DebugDisplayHitSize * 2f, EntityAlive.DebugDisplayHitSize, EntityAlive.DebugDisplayHitTime);
DebugLines.CreateAttached("EntityDamage2" + this.entityId.ToString(), transform, _damageSource.getHitTransformPosition(), transform.position + Origin.position, new Color(0f, 0f, 0.5f), new Color(0.3f, 0.3f, 1f), EntityAlive.DebugDisplayHitSize * 2f, EntityAlive.DebugDisplayHitSize, EntityAlive.DebugDisplayHitTime);
}
}
}
this.MinEventContext.Other = (this.world.GetEntity(damageResponse.Source.getEntityId()) as EntityAlive);
if (_damageSource.AffectedByArmor())
{
this.equipment.CalcDamage(ref damageResponse.Strength, ref damageResponse.ArmorDamage, damageResponse.Source.DamageTypeTag, this.MinEventContext.Other, damageResponse.Source.AttackingItem);
}
float num = this.GetDamageFraction((float)damageResponse.Strength);
if (damageResponse.Fatal || damageResponse.Strength >= this.Health)
{
if ((damageResponse.HitBodyPart & EnumBodyPartHit.Head) > EnumBodyPartHit.None)
{
if (num >= 0.2f)
{
damageResponse.Source.DismemberChance = Utils.FastMax(damageResponse.Source.DismemberChance * 0.5f, 0.3f);
}
}
else if (num >= 0.12f)
{
damageResponse.Source.DismemberChance = Utils.FastMax(damageResponse.Source.DismemberChance * 0.5f, 0.5f);
}
num = 1f;
}
this.CheckDismember(ref damageResponse, num);
int num2 = this.bodyDamage.StunKnee;
int num3 = this.bodyDamage.StunProne;
if ((damageResponse.HitBodyPart & EnumBodyPartHit.Head) > EnumBodyPartHit.None && damageResponse.Dismember)
{
if (this.Health > 0)
{
damageResponse.Strength = this.Health;
//Log.Out("EntityZombieSDX-damageEntityLocal HEAD DISMEMBER A");
dismemberedPart = EnumBodyPartHit.Head;
}
}
else if (_damageSource.CanStun && this.GetWalkType() != 21 && this.bodyDamage.CurrentStun != EnumEntityStunType.Prone)
{
if ((damageResponse.HitBodyPart & (EnumBodyPartHit.Torso | EnumBodyPartHit.Head | EnumBodyPartHit.LeftUpperArm | EnumBodyPartHit.RightUpperArm | EnumBodyPartHit.LeftLowerArm | EnumBodyPartHit.RightLowerArm)) > EnumBodyPartHit.None)
{
num3 += _strength;
}
else if (damageResponse.HitBodyPart.IsLeg())
{
num2 += _strength * (_criticalHit ? 2 : 1);
}
}
if ((!damageResponse.HitBodyPart.IsLeg() || !damageResponse.Dismember) && this.GetWalkType() != 21 && !this.sleepingOrWakingUp)
{
EntityClass entityClass = EntityClass.list[this.entityClass];
if (this.GetDamageFraction((float)num3) >= entityClass.KnockdownProneDamageThreshold && entityClass.KnockdownProneDamageThreshold > 0f)
{
if (this.bodyDamage.CurrentStun != EnumEntityStunType.Prone)
{
damageResponse.Stun = EnumEntityStunType.Prone;
damageResponse.StunDuration = this.rand.RandomRange(entityClass.KnockdownProneStunDuration.x, entityClass.KnockdownProneStunDuration.y);
}
}
else if (this.GetDamageFraction((float)num2) >= entityClass.KnockdownKneelDamageThreshold && entityClass.KnockdownKneelDamageThreshold > 0f && this.bodyDamage.CurrentStun != EnumEntityStunType.Prone)
{
damageResponse.Stun = EnumEntityStunType.Kneel;
damageResponse.StunDuration = this.rand.RandomRange(entityClass.KnockdownKneelStunDuration.x, entityClass.KnockdownKneelStunDuration.y);
}
}
bool flag2 = false;
int num4 = damageResponse.Strength + damageResponse.ArmorDamage / 2;
if (num4 > 0 && !this.IsGodMode.Value && damageResponse.Stun == EnumEntityStunType.None && !this.sleepingOrWakingUp)
{
flag2 = (damageResponse.Strength < this.Health);
if (flag2)
{
flag2 = (this.GetWalkType() == 21 || !damageResponse.Dismember || !damageResponse.HitBodyPart.IsLeg());
}
if (flag2 && damageResponse.Source.GetDamageType() != EnumDamageTypes.Bashing)
{
flag2 = (num4 >= 6);
}
if (damageResponse.Source.GetDamageType() == EnumDamageTypes.BarbedWire)
{
flag2 = true;
}
}
damageResponse.PainHit = flag2;
if (damageResponse.Strength >= this.Health)
{
damageResponse.Fatal = true;
}
if (damageResponse.Fatal)
{
damageResponse.Stun = EnumEntityStunType.None;
}
if (this.isEntityRemote)
{
damageResponse.ModStrength = 0;
}
else
{
if (this.Health <= damageResponse.Strength)
{
_strength -= this.Health;
}
damageResponse.ModStrength = _strength;
}
if (damageResponse.Dismember && this.IsAlive())
{
//Log.Out("EntityZombieSDX-damageEntityLocal DISMEMBER");
EntityAlive entityAlive = this.world.GetEntity(damageResponse.Source.getEntityId()) as EntityAlive;
if (entityAlive != null)
{
entityAlive.FireEvent(MinEventTypes.onDismember, true);
if (damageResponse.HitBodyPart == EnumBodyPartHit.Head)
{
dismemberedPart = EnumBodyPartHit.Head;
//Log.Out("EntityZombieSDX-damageEntityLocal HEAD DISMEMBER");
bool bRanged = entityAlive.inventory.holdingItem.ItemTags.ToString().ToLower().Contains("ranged");
bool bMelee = entityAlive.inventory.holdingItem.ItemTags.ToString().ToLower().Contains("melee");
bool bMale = this.EntityTags.ToString().ToLower().Contains("male");
bool bFemale = this.EntityTags.ToString().ToLower().Contains("female");
bool bBandit = this.EntityTags.ToString().ToLower().Contains("bandit");
bool bZombie = this.EntityTags.ToString().ToLower().Contains("zombie");
bool bEnemyRobot = this.EntityTags.ToString().ToLower().Contains("enemyrobot");
//Log.Out("EntityZombieSDX-damageEntityLocal Item Tags: " + entityAlive.inventory.holdingItem.ItemTags.ToString());
if (bZombie)
{
//Log.Out("EntityZombieSDX-damageEntityLocal ZOMBIE");
if (bRanged)
{
entityAlive.Buffs.AddBuff("FuriousRamsayDismemberedHeadRanged");
//Log.Out("EntityZombieSDX-damageEntityLocal ZOMBIE RANGED");
}
if (bMelee)
{
entityAlive.Buffs.AddBuff("FuriousRamsayDismemberedHeadRanged");
//Log.Out("EntityZombieSDX-damageEntityLocal ZOMBIE MELEE");
}
}
else if (bEnemyRobot)
{
//Log.Out("EntityZombieSDX-damageEntityLocal ENEMY ROBOT");
entityAlive.Buffs.AddBuff("FuriousRamsayDismemberedHeadEnemyRobot");
}
else if (bBandit)
{
if (bRanged)
{
entityAlive.Buffs.AddBuff("FuriousRamsayDismemberedHeadRanged");
//Log.Out("EntityZombieSDX-damageEntityLocal BANDIT RANGED");
}
if (bMelee)
{
entityAlive.Buffs.AddBuff("FuriousRamsayDismemberedHeadRanged");
//Log.Out("EntityZombieSDX-damageEntityLocal BANDIT MELEE");
}
}
}
}
}
if (this.MinEventContext.Other != null)
{
this.MinEventContext.Other.MinEventContext.DamageResponse = damageResponse;
float value = EffectManager.GetValue(PassiveEffects.HealthSteal, null, 0f, this.MinEventContext.Other, null, new FastTags<TagGroup.Global>(), true, true, true, true, true, 1, false);
if (value != 0f)
{
int num5 = (int)((float)num4 * value);
if (num5 + this.MinEventContext.Other.Health <= 0)
{
num5 = (this.MinEventContext.Other.Health - 1) * -1;
}
this.MinEventContext.Other.AddHealth(num5);
if (num5 < 0 && this.MinEventContext.Other is EntityPlayerLocal)
{
((EntityPlayerLocal)this.MinEventContext.Other).ForceBloodSplatter();
}
}
}
if (damageResponse.Source.BuffClass == null)
{
this.MinEventContext.DamageResponse = damageResponse;
this.FireEvent(MinEventTypes.onOtherAttackedSelf, true);
}
this.ProcessDamageResponseLocal(damageResponse);
return damageResponse;
}
public override float GetSeeDistance()
{
//Log.Out("EntityZombieSDX-GetSeeDistance START");
this.senseScale = 1f;
if (this.IsSleeping)
{
//Log.Out("EntityZombieSDX-GetSeeDistance 1");
this.sightRange = this.sleeperSightRange;
return this.sleeperSightRange;
}
this.sightRange = this.sightRangeBase;
if (this.aiManager != null)
{
//Log.Out("EntityZombieSDX-GetSeeDistance 2");
float num = EAIManager.CalcSenseScale();
this.senseScale = 1f + num * this.aiManager.feralSense;
this.sightRange = this.sightRangeBase * this.senseScale;
}
string rebirthFeralSense = RebirthVariables.customFeralSense;
int currentDay = GameUtils.WorldTimeToDays(GameManager.Instance.World.worldTime);
bool randomValid = rebirthFeralSense == "random" &&
currentDay == RebirthManager.nextFeralSenseDay;
if (randomValid && GameManager.Instance.World.IsDaytime() && RebirthManager.nextFeralSensePeriod == 1)
{
randomValid = false;
}
if (randomValid && !GameManager.Instance.World.IsDaytime() && RebirthManager.nextFeralSensePeriod == 2)
{
randomValid = false;
}
bool isValidFeralSense = (rebirthFeralSense == "always") ||
(GameManager.Instance.World.IsDaytime() && rebirthFeralSense == "dayonly") ||
(!GameManager.Instance.World.IsDaytime() && rebirthFeralSense == "nightonly") ||
randomValid;
string rebirthPOISense = RebirthVariables.customPOISense;
bool POISense = (rebirthPOISense == "always") ||
(GameManager.Instance.World.IsDaytime() && rebirthPOISense == "dayonly") ||
(!GameManager.Instance.World.IsDaytime() && rebirthPOISense == "nightonly");
if (isValidFeralSense || (this.IsSleeper && POISense))
{
this.sightRange = 200;
}
//Log.Out("EntityZombieSDX-GetSeeDistance this.sightRange: " + this.sightRange);
return this.sightRange;
}
public override string EntityName
{
get
{
string name = Localization.Get(this.entityName);
if (this.EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("invisible")))
{
name = "";
}
return name;
}
}
public override void CopyPropertiesFromEntityClass()
{
//Log.Out("EntityZombieSDX-CopyPropertiesFromEntityClass START");
base.CopyPropertiesFromEntityClass();
EntityClass entityClass = EntityClass.list[this.entityClass];
if (entityClass.Properties.Values.ContainsKey("GamestageStart"))
{
this.gamestageStart = int.Parse(entityClass.Properties.Values["GamestageStart"]);
}
if (entityClass.Properties.Values.ContainsKey("GamestageEnd"))
{
this.gamestageEnd = int.Parse(entityClass.Properties.Values["GamestageEnd"]);
}
if (entityClass.Properties.Values.ContainsKey("MaxJumpHeight"))
{
float flJumpHeight = StringParsers.ParseFloat(entityClass.Properties.Values["MaxJumpHeight"], 0, -1, NumberStyles.Any);
flMaxJumpHeight = flJumpHeight;
}
if (entityClass.Properties.Values.ContainsKey("MaxJumpSize"))
{
float flJumpSize = StringParsers.ParseFloat(entityClass.Properties.Values["MaxJumpSize"], 0, -1, NumberStyles.Any);
flMaxJumpSize = flJumpSize;
}
if (entityClass.Properties.Values.ContainsKey("MaxBaseJumpHeight"))
{
float flBaseJumpHeight = StringParsers.ParseFloat(entityClass.Properties.Values["MaxBaseJumpHeight"], 0, -1, NumberStyles.Any);
flMaxBaseJumpHeight = flBaseJumpHeight;
}
if (entityClass.Properties.Values.ContainsKey("LeapMaxDistance"))
{
float flLeapDistance = StringParsers.ParseFloat(entityClass.Properties.Values["LeapMaxDistance"], 0, -1, NumberStyles.Any);
flLeapMaxDistance = flLeapDistance;
}
}
public override void PostInit()
{
base.PostInit();
//Log.Out(GamePrefs.GetString(EnumGamePrefs.GameMode));
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
{
//Log.Out("IS SINGLE PLAYER");
}
else
{
ItemValue handItem = this.GetHandItem();
if (flHandItemRangeMP > 0)
{
this.inventory.holdingItem.Actions[0].Range = flHandItemRangeMP;
}
else
{
this.inventory.holdingItem.Actions[0].Range = (float)0.98;
}
//Log.Out("IS MULTIPLAYER");
}
//Log.Out("EntityZombieSDX-PostInit Zombie Range: " + this.inventory.holdingItem.Actions[0].Range);
}
public override bool IsAttackValid()
{
//Log.Out("EntityZombieSDX-IsAttackValid 0");
if (this.emodel.IsRagdollMovement)
{
//Log.Out("EntityZombieSDX-IsAttackValid 1");
return false;
}
if (this.Electrocuted)
{
//Log.Out("EntityZombieSDX-IsAttackValid 2");
return false;
}
if (this.bodyDamage.CurrentStun == EnumEntityStunType.Kneel || this.bodyDamage.CurrentStun == EnumEntityStunType.Prone)
{
//Log.Out("EntityZombieSDX-IsAttackValid 3");
return false;
}
bool flag1 = !(this.emodel != null);
//Log.Out("EntityZombieSDX-IsAttackValid flag1: " + flag1);
bool flag2 = !(this.emodel.avatarController != null);
//Log.Out("EntityZombieSDX-IsAttackValid flag2: " + flag2);
bool flag3 = !this.emodel.avatarController.IsAttackPrevented();
//Log.Out("EntityZombieSDX-IsAttackValid flag3: " + flag3);
bool flag4 = !this.IsDead();
//Log.Out("EntityZombieSDX-IsAttackValid flag4: " + flag4);
bool flag5 = this.painResistPercent >= 1f;
//Log.Out("EntityZombieSDX-IsAttackValid flag5: " + flag5);
bool flag6 = this.hasBeenAttackedTime <= 0;
//Log.Out("EntityZombieSDX-IsAttackValid flag6: " + flag6);
bool flag7 = this.emodel.avatarController == null;
//Log.Out("EntityZombieSDX-IsAttackValid flag7: " + flag7);
bool flag8 = !this.emodel.avatarController.IsAnimationHitRunning();
//Log.Out("EntityZombieSDX-IsAttackValid flag8: " + flag8);
return (flag1 || flag2 || flag3) && flag4 && (flag5 || (flag6 && (flag7 || flag8)));
}
private Dictionary<string, Transform> particles = new Dictionary<string, Transform>();
private void ApplyLocalBodyDamage(DamageResponse _dmResponse)
{
if (_dmResponse.Dismember)
{
switch (_dmResponse.HitBodyPart)
{
case EnumBodyPartHit.Head:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 1U);
break;
case EnumBodyPartHit.LeftUpperArm:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 2U);
break;
case EnumBodyPartHit.RightUpperArm:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 8U);
break;
case EnumBodyPartHit.LeftUpperLeg:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 32U);
this.bodyDamage.ShouldBeCrawler = true;
break;
case EnumBodyPartHit.RightUpperLeg:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 128U);
this.bodyDamage.ShouldBeCrawler = true;
break;
case EnumBodyPartHit.LeftLowerArm:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 4U);
break;
case EnumBodyPartHit.RightLowerArm:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 16U);
break;
case EnumBodyPartHit.LeftLowerLeg:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 64U);
this.bodyDamage.ShouldBeCrawler = true;
break;
case EnumBodyPartHit.RightLowerLeg:
this.bodyDamage.Flags = (this.bodyDamage.Flags | 256U);
this.bodyDamage.ShouldBeCrawler = true;
break;
}
}
if (_dmResponse.TurnIntoCrawler)
{
this.bodyDamage.ShouldBeCrawler = true;
}
if (_dmResponse.CrippleLegs)
{
if (_dmResponse.HitBodyPart.IsLeftLeg())
{
this.bodyDamage.Flags = (this.bodyDamage.Flags | 4096U);
}
else if (_dmResponse.HitBodyPart.IsRightLeg())
{
this.bodyDamage.Flags = (this.bodyDamage.Flags | 8192U);
}
}
this.bodyDamage.damageType = _dmResponse.Source.damageType;
this.bodyDamage.bodyPartHit = _dmResponse.HitBodyPart;
}
public override void StartJump()
{
this.jumpState = EntityAlive.JumpState.Leap;
this.jumpStateTicks = 0;
this.jumpDistance = 1f;
this.jumpHeightDiff = 0f;
this.disableFallBehaviorUntilOnGround = true;
if (this.isSwimming)
{
this.jumpState = EntityAlive.JumpState.SwimStart;
if (this.emodel.avatarController != null)
{
this.emodel.avatarController.SetSwim(true);
return;
}
}
else if (this.emodel.avatarController != null)
{
this.emodel.avatarController.StartAnimationJump(AnimJumpMode.Start);
}
}
public override bool CanDamageEntity(int _sourceEntityId)
{
//Log.Out("SOURCE ENTITY: " + entityAlive.EntityName);
return true;
}
public override int DamageEntity(DamageSource _damageSource, int _strength, bool _criticalHit, float _impulseScale = 1f)
{
//Log.Out($"EntityZombieSDX::DamageEntity this: {this}, _damageSource creator id: {_damageSource.CreatorEntityId}, owner id: {_damageSource.ownerEntityId}, getEntityId: {_damageSource.getEntityId()}");
//Log.Out("EntityZombieSDX-DamageEntity 1: " + this.EntityClass.entityClassName);
if ((_damageSource.GetDamageType() == EnumDamageTypes.Falling))
{
//Log.Out("EntityZombieSDX-DamageEntity 2");
if (GetWeight() == 69)
{
//Log.Out("EntityZombieSDX-DamageEntity 3");
return 0;
}
else
{
//Log.Out("EntityZombieSDX-DamageEntity 4");
_strength = (_strength + 1) / 2;
int num = (GetMaxHealth() + 2) / 3;
if (_strength > num)
{
_strength = num;
}
}
}
EnumDamageSource source = _damageSource.GetSource();
bool flag = _damageSource.GetDamageType() == EnumDamageTypes.Heat;
bool flag1 = false;
//Log.Out("EntityZombieSDX-DamageEntity _damageSource.damageType: " + _damageSource.damageType);
if (_damageSource.GetDamageType() == EnumDamageTypes.None && _damageSource.AttackingItem != null)
{
//Log.Out("EntityZombieSDX-DamageEntity _damageSource.AttackingItem.ItemClass.GetItemName(): " + _damageSource.AttackingItem.ItemClass.GetItemName());
string item = _damageSource.AttackingItem.ItemClass.GetItemName().ToLower();
if (item == "auraexplosion" || item == "throwngrenadecontact")
{
flag1 = true;
}
}
if (flag)
{
flag1 = true;
}
if (flag1)
{
// Give Regen Prevention Debuff
Buffs.AddBuff("buffDamagedByExplosion");
}
if (flag && _damageSource.AttackingItem != null && _damageSource.AttackingItem.ItemClass.GetItemName() == "otherExplosion")
{
return 0;
}
EntityAlive entityAlive = world.GetEntity(_damageSource.getEntityId()) as EntityAlive;
if (_damageSource.IsIgnoreConsecutiveDamages() && source != EnumDamageSource.Internal)
{
//Log.Out("EntityZombieSDX-DamageEntity 5");
if (damageSourceTimeouts.ContainsKey(source) && GameTimer.Instance.ticks - damageSourceTimeouts[source] < 30UL)
{
//Log.Out("EntityZombieSDX-DamageEntity 6");
return 0;
}
damageSourceTimeouts[source] = GameTimer.Instance.ticks;
}
//Log.Out("EntityZombieSDX-DamageEntity _damageSource.CreatorEntityId: " + _damageSource.CreatorEntityId);
if (entityThatKilledMeID == -1)
{
entityThatKilledMeID = _damageSource.getEntityId();
}
if (entityAlive is EntityZombieSDX)
{
string buffCompare = "FuriousRamsayRangedMindControlBuffTier";
for (int i = 0; i < entityAlive.Buffs.ActiveBuffs.Count; i++)
{
BuffValue buffValue = entityAlive.Buffs.ActiveBuffs[i];
if (buffValue != null && buffValue.BuffClass != null)
{
//Log.Out("EntityZombieSDX-DamageEntity buffValue.BuffName[" + i + "]: " + buffValue.BuffName);
if (buffValue.BuffName.ToLower().Contains(buffCompare.ToLower()))
{
//Log.Out("EntityZombieSDX-DamageEntity FOUND BUFF");
Entity instigator = world.GetEntity(buffValue.instigatorId);
if (instigator is EntityPlayer)
{
Buffs.SetCustomVar("$killedby", instigator.entityId);
//Log.Out("EntityZombieSDX-DamageEntity FOUND PLAYER");
break;
}
}
}
}
}
bool bMindControlled = Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier1") || Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier2") || Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier3");
if (entityAlive is EntityPlayer && bMindControlled)
{
//Log.Out("EntityZombieSDX-DamageEntity 7");
return 0;
}
if (!FriendlyFireCheck(entityAlive))
{
//Log.Out("EntityZombieSDX-DamageEntity 8");
return 0;
}
bool shouldAttack = RebirthUtilities.VerifyFactionStanding(this, entityAlive);
if (!shouldAttack && !(entityAlive is EntityPlayer) && entityAlive &&
!(_damageSource.damageType == EnumDamageTypes.Heat && (entityAlive.EntityClass.entityClassName.ToLower().Contains("furiousramsaykamikaze")) || entityAlive.EntityClass.entityClassName.ToLower().Contains("fatcop")))
{
//Log.Out($"EntityZombieSDX-DamageEntity !shouldAttack: {shouldAttack}");
return 0;
}
if (IsGodMode.Value)
{
//Log.Out("EntityZombieSDX-DamageEntity 10");
return 0;
}
if (entityAlive != null)
{
//Log.Out($"EntityZombieSDX-DamageEntity this: {this}, entityAlive: {entityAlive}");
float value = EffectManager.GetValue(PassiveEffects.DamageBonus, null, 0f, entityAlive, null, new FastTags<TagGroup.Global>(), true, true, true, true, true, 1);
if (value > 0f)
{
//Log.Out("EntityZombieSDX-DamageEntity 12");
_damageSource.DamageMultiplier = value;
_damageSource.BonusDamageType = EnumDamageBonusType.Sneak;
}
}
bool optionCustomHeadshot = RebirthVariables.customHeadshot;
if (optionCustomHeadshot && entityAlive is EntityPlayer && !EntityClass.entityClassName.Contains("animalZombie") && !HasAnyTags(FastTags<TagGroup.Global>.Parse("noheadshot")))
{
//Log.Out("EntityZombieSDX-DamageEntity 13");
bool isTurret = false;
if (_damageSource.AttackingItem != null)
{
if (_damageSource.AttackingItem.ItemClass != null)
{
isTurret = (_damageSource.AttackingItem.ItemClass.GetItemName().Contains("JunkTurret")) && (entityAlive.inventory.holdingItem.GetItemName() != "gunBotT2JunkTurret");
}
}
//Log.Out("EntityZombieSDX-DamageEntity isTurret: " + isTurret);
if (!isTurret)
{
//Log.Out("EntityZombieSDX-DamageEntity optionCustomHeadshot: " + optionCustomHeadshot);
string className = EntityClass.entityClassName;
if (_damageSource.GetEntityDamageBodyPart(this) != EnumBodyPartHit.Head && !(_damageSource.damageType == EnumDamageTypes.Heat))
{
//Log.Out("EntityZombieSDX-DamageEntity NOT HEAD SHOT");
if (entityAlive.inventory.holdingItem.HasAnyTags(FastTags<TagGroup.Global>.Parse("ranged")))
{
_strength = (int)(_strength * 0.05);
//Log.Out("EntityZombieSDX-DamageEntity RANGED DAMAGE: " + _strength);
}
else
{
_strength = (int)(_strength * 0.025);
//Log.Out("EntityZombieSDX-DamageEntity MELEE DAMAGE: " + _strength);
}
}
else
{
//Log.Out("EntityZombieSDX-DamageEntity HEAD SHOT");
if (HasAnyTags(FastTags<TagGroup.Global>.Parse("helmet")))
{
_strength = (int)(_strength * .85);
//Log.Out("EntityZombieSDX-DamageEntity HAS HELMET, DAMAGE: " + _strength);
}
//else
//{
//Log.Out("EntityZombieSDX-DamageEntity NO HELMET, DAMAGE: " + _strength);
//}
}
}
}
DamageResponse damageResponse = damageEntityLocal(_damageSource, _strength, _criticalHit, _impulseScale);
if (Health == 0f)
{
//Log.Out("EntityZombieSDX-DamageEntity HEALTH IS ZERO");
if (entityAlive != null)
{
//Log.Out("EntityZombieSDX-DamageEntity entityAlive: " + entityAlive.EntityClass.entityClassName);
//Log.Out("EntityZombieSDX-DamageEntity entityAlive.entityId: " + entityAlive.entityId);
entityThatKilledMe = entityAlive;
}
//Log.Out("EntityZombieSDX-DamageEntity entityThatKilledMeID: " + this.entityThatKilledMeID);
EntityAlive entityKiller = world.GetEntity(entityThatKilledMeID) as EntityAlive;
if (entityKiller != null && entityKiller is EntityPlayer)
{
//Log.Out("EntityZombieSDX-DamageEntity entityKiller.entityId: " + entityKiller.entityId);
if (flag)
{
//Log.Out("EntityZombieSDX-DamageEntity flag: " + flag);
int biomeID = 3;
if (biomeStandingOn != null)
{
biomeID = biomeStandingOn.m_Id;
}
else
{
BiomeDefinition biomeAt = GameManager.Instance.World.ChunkCache.ChunkProvider.GetBiomeProvider().GetBiomeAt((int)this.position.x, (int)this.position.z);
if (biomeAt != null)
{
biomeID = biomeAt.m_Id;
}
}
if (!RebirthUtilities.IsHordeNight())
{
RebirthUtilities.ProcessCheckAchievements(biomeID, entityKiller, this);
}
}
}
}
if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("zombieleader")))
{
float flSpawnedMinions = Buffs.GetCustomVar("$SpawnedMinions");
//Log.Out("EntityZombieSDX-DamageEntity flSpawnedMinions: " + flSpawnedMinions);
if (flSpawnedMinions == 0 && !RebirthUtilities.IsHordeNight() && ((Health / Stats.Health.ModifiedMax) < .9f))
{
Buffs.SetCustomVar("$SpawnedMinions", 1f);
Manager.BroadcastPlay(position, "FuriousRamsayZombieLeaderScream");
int EntityID = entityId;
bool attackPlayer = false;
if (entityAlive is EntityPlayer)
{
//Log.Out("EntityZombieSDX-DamageEntity 1");
EntityID = entityAlive.entityId;
attackPlayer = true;
}
else if (attackTarget is EntityPlayer)
{
//Log.Out("EntityZombieSDX-DamageEntity 2");
EntityID = attackTarget.entityId;
attackPlayer = true;
}
else
{
//Log.Out("EntityZombieSDX-DamageEntity 3");
EntityPlayer player = world.GetClosestPlayer(this, 60f, false);
if (player != null)
{
//Log.Out("EntityZombieSDX-DamageEntity 4");
EntityID = player.entityId;
attackPlayer = true;
}
}
//Log.Out("EntityZombieSDX-DamageEntity attackPlayer: " + attackPlayer);
generatedNumbers.Clear();
if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("tainted")))
{
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_1_2aTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_2_3bTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_3_2bTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_3cTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_2cTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_5_3dTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_1_3cTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_2_2aTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_3_3aTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_3dTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_5_2bTainted", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
}
else if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("radiated")))
{
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_1_2aRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_2_3bRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_3_2bRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_3cRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_2cRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_5_3dRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_1_3cRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_2_2aRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_3_3aRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_3dRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_5_2bRadiated", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
}
else if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("feral")))
{
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_1_2aFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_2_3bFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_3_2bFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_3cFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_2cFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_5_3dFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_1_3cFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_2_2aFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_3_3aFeral", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
}
else
{
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_1_2a", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_2_3b", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_3_2b", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_3c", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_4_2c", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1");
RebirthUtilities.SpawnEntity(this.entityId, "FuriousRamsayZombie020_5_3d", 1, "", "", "30", "dynamic", "1", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1");
}
}
}
else if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("zombiegrudge")))
{
float flSpawnedMinions = Buffs.GetCustomVar("$SpawnedMinions");
if (flSpawnedMinions == 0 && !RebirthUtilities.IsHordeNight() && Health == 0f)
{
this.Buffs.SetCustomVar("$SpawnedMinions", 1f);
Manager.BroadcastPlay(position, "FuriousRamsayDuplicate");
int EntityID = entityId;
bool attackPlayer = false;
if (entityAlive is EntityPlayer)
{
EntityID = entityAlive.entityId;
attackPlayer = true;
}
else if (attackTarget is EntityPlayer)
{
EntityID = attackTarget.entityId;
attackPlayer = true;
}
else
{
EntityPlayer player = world.GetClosestPlayer(this, 60f, false);
if (player != null)
{
EntityID = player.entityId;
attackPlayer = true;
}
}
generatedNumbers.Clear();
if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("tainted")))
{
RebirthUtilities.SpawnEntity(entityId, "FuriousRamsayZombieGirl002Tainted", 6, "", "", "0", "dynamic", "", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
}
else if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("radiated")))
{
RebirthUtilities.SpawnEntity(entityId, "FuriousRamsayZombieGirl002Radiated", 5, "", "", "0", "dynamic", "", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Radiated");
}
else if (EntityTags.Test_AnySet(FastTags<TagGroup.Global>.Parse("feral")))
{
RebirthUtilities.SpawnEntity(entityId, "FuriousRamsayZombieGirl002Feral", 4, "", "", "0", "dynamic", "", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1Feral");
}
else
{
RebirthUtilities.SpawnEntity(entityId, "FuriousRamsayZombieGirl002", 2, "", "", "0", "dynamic", "", "", 1, -1, true, false, attackPlayer, EntityID, -1, "", 1, 0, 40, 1, 1, -1, -1, "", "", 1, "", "FuriousRamsayMinionBuffTier1");
}
}
}
NetPackage package = NetPackageManager.GetPackage<NetPackageDamageEntity>().Setup(entityId, damageResponse);
if (world.IsRemote())
{
//Log.Out("EntityZombieSDX-DamageEntity 14");
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer(package, false);
}
else
{
//Log.Out("EntityZombieSDX-DamageEntity 15");
/*
int excludePlayer = -1;
if (!flag && _damageSource.CreatorEntityId != -2)
{
//Log.Out("EntityZombieSDX-DamageEntity 16");
excludePlayer = _damageSource.getEntityId();
if (_damageSource.CreatorEntityId != -1)
{
//Log.Out("EntityZombieSDX-DamageEntity 17");
Entity entity = world.GetEntity(_damageSource.CreatorEntityId);
if (entity && !entity.isEntityRemote)
{
//Log.Out("EntityZombieSDX-DamageEntity 18");
excludePlayer = -1;
}
}
}
Log.Out($"EntityZombieSDX::DamageEntity - SendPacket entityId: {entityId}, excludePlayer: {excludePlayer}");
world.entityDistributer.SendPacketToTrackedPlayersAndTrackedEntity(entityId, excludePlayer, package);
*/
// don't exclude any player
world.entityDistributer.SendPacketToTrackedPlayersAndTrackedEntity(entityId, -1, package);
}
return damageResponse.ModStrength;
}
public override void OnEntityDeath()
{
//Log.Out("EntityZombieSDX-OnEntityDeath START");
/*foreach (String s in this.particles.Keys)
{
Log.Out("EntityZombieSDX-OnEntityDeath this.particles[" + s + "].name: " + this.particles[s].name);
}*/
if (RebirthUtilities.IsHordeNight())
{
this.lootListOnDeath = "";
}
if (this.entityThatKilledMe != null)
{
//Log.Out("EntityZombieSDX-OnEntityDeath this.entityThatKilledMe.EntityClass.entityClassName: " + this.entityThatKilledMe.EntityClass.entityClassName);
entityThatKilledMeID = this.entityThatKilledMe.entityId;
if (this.entityThatKilledMe is EntitySurvivor)
{
if (this.entityThatKilledMe.belongsPlayerId > 0)
{
//Log.Out("RebirthUtilities-OnEntityDeath BELONGS TO: " + this.entityThatKilledMe.belongsPlayerId);
EntityPlayer entityPlayer = (EntityPlayer)this.world.GetEntity(this.entityThatKilledMe.belongsPlayerId);
if (entityPlayer != null)
{
this.entityThatKilledMe = entityPlayer;
entityThatKilledMeID = entityPlayer.entityId;
}
}
}
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
{
//Log.Out("EntityZombieSDX-OnEntityDeath IS SERVER");
if (dismemberedPart != EnumBodyPartHit.Head && RebirthUtilities.WillLiveAgain(this))
{
//Log.Out("EntityZombieSDX-OnEntityDeath REMOVE LOOT LIST");
this.lootListOnDeath = "";
}
}
}
else
{
//Log.Out("EntityZombieSDX-OnEntityDeath NO CLUE WHO KILLED ME, entityThatKilledMeID: " + entityThatKilledMeID);
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
{
if (entityThatKilledMeID > 0)
{
//Log.Out("EntityZombieSDX-OnEntityDeath IS SERVER");
SingletonMonoBehaviour<ConnectionManager>.Instance.SendPackage(NetPackageManager.GetPackage<NetPackageSetInstigatorRebirth>().Setup(this.entityId, entityThatKilledMeID), false, -1, -1, -1, null, 192);
}
}
EntityAlive entity = this.world.GetEntity(entityThatKilledMeID) as EntityAlive;
if (entity != null)
{
this.entityThatKilledMe = entity;
//Log.Out("EntityZombieSDX-OnEntityDeath this.entityThatKilledMe: " + this.entityThatKilledMe.EntityClass.entityClassName);
}
}
if (this.deathUpdateTime != 0)
{
//Log.Out("EntityZombieSDX-OnEntityDeath A");
return;
}
//Log.Out("EntityZombieSDX-OnEntityDeath ADDSCORE");
this.AddScore(1, 0, 0, -1, 0);
if (this.soundLiving != null && this.soundLivingID >= 0)
{
//Log.Out("EntityZombieSDX-OnEntityDeath B");
Manager.Stop(this.entityId, this.soundLiving);
this.soundLivingID = -1;
}
if (this.AttachedToEntity)
{
//Log.Out("EntityZombieSDX-OnEntityDeath C");
this.Detach();
}
if (this.isEntityRemote)
{
//Log.Out("EntityZombieSDX-OnEntityDeath D");
return;
}
//Log.Out("EntityZombieSDX-OnEntityDeath entityThatKilledMeID: " + entityThatKilledMeID);
if (entityThatKilledMeID > 0)
{
//Log.Out("EntityZombieSDX-OnEntityDeath 1");
if (this.entityThatKilledMe is EntityNPCRebirth)
{
//Log.Out("EntityZombieSDX-OnEntityDeath 2");
EntityNPCRebirth npc = (EntityNPCRebirth)(this.entityThatKilledMe);
if (npc && npc.LeaderUtils.Owner)
{
//Log.Out("EntityZombieSDX-OnEntityDeath 3");
float distanceEntity = npc.LeaderUtils.Owner.GetDistance(this.entityThatKilledMe);
if (distanceEntity <= 50)
{
//Log.Out("EntityZombieSDX-OnEntityDeath 4");
this.AwardKill(npc.LeaderUtils.Owner);
}
}
}
else
{
//Log.Out("EntityZombieSDX-OnEntityDeath 5, this.entityThatKilledMe == null: " + (this.entityThatKilledMe == null));
//Log.Out("EntityZombieSDX-OnEntityDeath 5, EntityName: " + this.entityThatKilledMe.EntityName);
this.AwardKill(this.entityThatKilledMe);
}
}
if (this.particleOnDeath != null && this.particleOnDeath.Length > 0)
{
float lightBrightness = this.world.GetLightBrightness(base.GetBlockPosition());
this.world.GetGameManager().SpawnParticleEffectServer(new ParticleEffect(this.particleOnDeath, this.getHeadPosition(), lightBrightness, Color.white, null, null, false), this.entityId, false, false);
}
if (this.isGameMessageOnDeath())
{
GameManager.Instance.GameMessage(EnumGameMessages.EntityWasKilled, this, this.entityThatKilledMe);
}
if (this.entityThatKilledMe != null)
{
Log.Out("Entity {0} {1} killed by {2} {3}", new object[]
{
base.GetDebugName(),
this.entityId,
this.entityThatKilledMe.GetDebugName(),
this.entityThatKilledMe.entityId
});
}
else
{
Log.Out("Entity {0} {1} killed", new object[]
{
base.GetDebugName(),
this.entityId
});
}
ModEvents.EntityKilled.Invoke(this, this.entityThatKilledMe);
this.dropItemOnDeath();
//Log.Out("EntityZombieSDX-OnEntityDeath CLEAR ENTITYTHATKILLEDME");
//this.entityThatKilledMe = null;
}
public override void OnUpdateLive()
{
bool isHordeNight = RebirthUtilities.IsHordeNight();
//RebirthUtilities.CheckSleeperActivated(this);
if (!setSize)
{
float sizeScale = this.Buffs.GetCustomVar("$StartScale");
if (sizeScale > 0f)
{
this.SetScale(sizeScale);
}
setSize = true;
}
if (!setNavIcon)
{
//Log.Out("RebirthUtilities-OnUpdateLive entity: " + this.EntityName);
if (RebirthVariables.customEventsNotification && this.Buffs.GetCustomVar("$EventNavIcon") == 1f)
{
if (RebirthVariables.customTargetBarVisibility == "always")
{
if (this.Buffs.GetCustomVar("$varFuriousRamsaySupportMinion") == 1f)
{
//Log.Out("RebirthUtilities-OnUpdateLive NAV1");
this.AddNavObject(RebirthVariables.navIconSupportEvent, "", "");
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive NAV2");
this.AddNavObject(RebirthVariables.navIconBossEvent, "", "");
}
}
else
{
if (this.Buffs.GetCustomVar("$varFuriousRamsaySupportMinion") == 1f)
{
//Log.Out("RebirthUtilities-OnUpdateLive NAV3");
this.AddNavObject(RebirthVariables.navIconSupportEventNoHealth, "", "");
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive NAV4");
this.AddNavObject(RebirthVariables.navIconBossEventNoHealth, "", "");
}
}
}
setNavIcon = true;
}
float zombieVerifyTick = 2f;
if ((Time.time - zombieVerifyCheck) > zombieVerifyTick)
{
zombieVerifyCheck = Time.time;
bool bMindControlled = this.Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier1") || this.Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier2") || this.Buffs.HasBuff("FuriousRamsayRangedMindControlBuffTier3");
if (bMindControlled)
{
this.maxViewAngle = 360;
}
else
{
this.maxViewAngle = StringParsers.ParseFloat(this.EntityClass.Properties.Values[EntityClass.PropMaxViewAngle]);
}
//Log.Out("RebirthUtilities-OnUpdateLive this.maxViewAngle: " + this.maxViewAngle);
}
float zombieModelLayerTick = 5f;
if (RebirthVariables.noHit && RebirthVariables.logModelLayerCheck && (Time.time - zombieModelLayerCheck) > zombieModelLayerTick)
{
zombieModelLayerCheck = Time.time;
if (RebirthVariables.noHit)
{
Log.Out("RebirthUtilities-OnUpdateLive NO HIT, modellayer: " + this.GetModelLayer());
}
List<Transform> setLayerRecursivelyList = new List<Transform>();
this.emodel.GetModelTransform().gameObject.GetComponentsInChildren<Transform>(true, setLayerRecursivelyList);
List<Transform> list = setLayerRecursivelyList;
bool foundLayer = false;
for (int i = list.Count - 1; i >= 0; i--)
{
if (list[i].gameObject.layer == 2)
{
ulong worldTime = GameManager.Instance.World.worldTime;
ValueTuple<int, int, int> valueTuple = GameUtils.WorldTimeToElements(worldTime);
int numDays = valueTuple.Item1;
int numHours = valueTuple.Item2;
int numMinutes = valueTuple.Item3;
foundLayer = true;
Log.Out("RebirthUtilities-OnUpdateLive gameObject: " + list[i].gameObject.name + " / Layer: " + list[i].gameObject.layer + " / Game Time: " + numDays + "D: " + numHours + "H: " + numMinutes + "M");
}
}
if (foundLayer)
{
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
if (primaryPlayer != null)
{
GameManager.ShowTooltip(primaryPlayer, this.entityName + "'s Model Layer is set to 2, preventing hits");
}
}
}
this.hasAI = false;
//Log.Out("this.theEntity.emodel.IsRagdollMovement: " + this.emodel.IsRagdollMovement);
//Log.Out("RANGE: " + this.inventory.holdingItem.Actions[0].Range);
if (this.bDead && !isHordeNight)
{
//Log.Out("RebirthUtilities-OnUpdateLive IS DEAD");
if (this.entityThatKilledMe != null)
{
//Log.Out("RebirthUtilities-OnUpdateLive this.entityThatKilledMe.EntityClass.entityClassName: " + this.entityThatKilledMe.EntityClass.entityClassName);
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive NO CLUE WHO KILLED ME, this.entityThatKilledMeID: " + this.entityThatKilledMeID);
this.entityThatKilledMe = (global::EntityAlive)this.world.GetEntity(this.entityThatKilledMeID);
if (this.entityThatKilledMe != null)
{
//Log.Out("RebirthUtilities-OnUpdateLive this.entityThatKilledMe: " + this.entityThatKilledMe.EntityClass.entityClassName);
}
}
ulong elpasedTimeDead = GameTimer.Instance.ticks - AccumulatedTicksDead;
float willLiveAgain = this.Buffs.GetCustomVar("$willLiveAgain");
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer && willLiveAgain == 1f)
{
if (elpasedTimeDead >= 80UL)
{
this.Buffs.SetCustomVar("$willLiveAgain", 0f);
//Log.Out("RebirthUtilities-OnUpdateLive $reborn: " + this.Buffs.GetCustomVar("$reborn"));
RebirthUtilities.Reborn(this);
return;
}
}
if (!GameManager.IsDedicatedServer)
{
if (this.lootContainer != null)
{
//Log.Out("RebirthUtilities-OnUpdateLive CONTAINER EXISTS");
//Log.Out("RebirthUtilities-OnUpdateLive this.lootContainer.bTouched: " + this.lootContainer.bTouched);
bool flag = this.lootContainer != null;
bool flag1 = !this.lootContainer.bTouched;
bool flag2 = this.entityThatKilledMe is EntityPlayer;
bool flag3 = this.entityThatKilledMe is EntityNPCRebirth;
bool flag4 = this.entityThatKilledMe is EntitySurvivor;
bool flag5 = this.entityThatKilledMe is EntityZombieSDX;
bool flag6 = this.entityPlayer == null;
bool flag7 = this.entityThatKilledMe == null;
//Log.Out("RebirthUtilities-OnUpdateLive this.lootContainer != null: " + flag);
//Log.Out("RebirthUtilities-OnUpdateLive !this.lootContainer.bTouched: " + flag1);
//Log.Out("RebirthUtilities-OnUpdateLive this.entityThatKilledMe is EntityPlayer: " + flag2);
//Log.Out("RebirthUtilities-OnUpdateLive this.entityThatKilledMe is EntityNPCRebirth: " + flag3);
//Log.Out("RebirthUtilities-OnUpdateLive this.entityThatKilledMe is EntitySurvivor: " + flag4);
//Log.Out("RebirthUtilities-OnUpdateLive this.entityThatKilledMe is EntityZombieSDX: " + flag5);
//Log.Out("RebirthUtilities-OnUpdateLive this.entityPlayer == null: " + flag6);
//Log.Out("RebirthUtilities-OnUpdateLive this.entityThatKilledMe == null: " + flag7);
//Log.Out("RebirthUtilities-OnUpdateLive elpasedTimeDead: " + elpasedTimeDead);
if (flag && flag1 && (flag2 || flag3 || flag4 || flag5) && flag6)
{
//Log.Out("RebirthUtilities-OnUpdateLive J");
//Log.Out("RebirthUtilities-OnUpdateLive AccumulatedTicksDead: " + AccumulatedTicksDead);
//Log.Out("RebirthUtilities-OnUpdateLive elpasedTimeDead: " + elpasedTimeDead);
if (elpasedTimeDead >= 80UL)
{
if (!removedParticles)
{
RebirthUtilities.RemoveCommonParticles(this);
removedParticles = true;
}
//Log.Out("RebirthUtilities-OnUpdateLive elpasedTimeDead >= 80UL");
AccumulatedTicksDead = GameTimer.Instance.ticks;
bool isValid = false;
bool isPlayer = false;
if (this.entityThatKilledMe is EntityPlayer)
{
//Log.Out("RebirthUtilities-OnUpdateLive KILLED BY PLAYER");
this.entityPlayer = (EntityPlayer)this.entityThatKilledMe;
isValid = true;
isPlayer = true;
}
else if (this.entityThatKilledMe is EntityNPCRebirth)
{
EntityNPCRebirth npc = (EntityNPCRebirth)this.entityThatKilledMe;
if (npc && npc.LeaderUtils.Owner)
{
//Log.Out("RebirthUtilities-OnUpdateLive KILLED BY PLAYER ALLY");
isValid = true;
this.entityPlayer = (EntityPlayer)npc.LeaderUtils.Owner;
this.entityThatKilledMe = (EntityPlayer)npc.LeaderUtils.Owner;
}
}
else if (this.entityThatKilledMe is EntityZombieSDX)
{
//Log.Out("RebirthUtilities-OnUpdateLive KILLED BY ZOMBIE");
int killedByID = (int)this.Buffs.GetCustomVar("$killedby");
if (killedByID > 0)
{
EntityPlayer entityPlayer = (EntityPlayer)this.world.GetEntity(killedByID);
if (entityPlayer != null)
{
//Log.Out("RebirthUtilities-OnUpdateLive FOUND PLAYER KILLER B");
isValid = true;
this.entityPlayer = entityPlayer;
this.entityThatKilledMe = entityPlayer;
}
}
}
if (isValid)
{
//Log.Out("RebirthUtilities-OnUpdateLive IS VALID");
bool lootCorpses = false;
if (this.entityPlayer)
{
lootCorpses = RebirthUtilities.HasMod(this.entityPlayer, "FuriousRamsayLootCorpses");
}
if (lootCorpses)
{
//Log.Out("RebirthUtilities-OnUpdateLive GATHER LOOT");
float containerMod = 0f;
float containerBonus = 0f;
//Log.Out("RebirthUtilities-OnUpdateLive this.lootContainer.EntityId: " + this.lootContainer.EntityId);
//Log.Out("RebirthUtilities-OnUpdateLive this.lootContainer.lootListName: " + this.lootContainer.lootListName);
float lootStage = (float)this.entityPlayer.GetHighestPartyLootStage(containerMod, containerBonus);
//Log.Out("RebirthUtilities-OnUpdateLive lootStage: " + lootStage);
GameManager.Instance.lootManager.LootContainerOpened(this.lootContainer, this.entityPlayer.entityId, this.EntityTags);
this.lootContainer.bTouched = true;
this.lootContainer.SetModified();
//Log.Out("RebirthUtilities-OnUpdateLive EntityTags: " + this.EntityTags);
bool addItems = false;
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
ItemStack[] array = this.lootContainer.items;
//Log.Out("RebirthUtilities-OnUpdateLive isPlayer: " + isPlayer);
//Log.Out("RebirthUtilities-OnUpdateLive array.Length: " + array.Length);
for (int i = 0; i < array.Length; i++)
{
//Log.Out("RebirthUtilities-OnUpdateLive i: " + i);
ItemStack itemStack = array[i];
bool skipItem = false;
//Log.Out("RebirthUtilities-OnUpdateLive itemStack.IsEmpty(): " + itemStack.IsEmpty());
if (!itemStack.IsEmpty())
{
//Log.Out("RebirthUtilities-OnUpdateLive GetItemName: " + itemStack.itemValue.ItemClass.GetItemName());
//Log.Out("RebirthUtilities-OnUpdateLive itemStack.itemValue.ItemClass.Name: " + itemStack.itemValue.ItemClass.Name);
}
if (!isPlayer && !itemStack.IsEmpty() && (
itemStack.itemValue.ItemClass.Name == "foodRottingFlesh"
))
{
//Log.Out("RebirthUtilities-OnUpdateLive SKIP A ");
}
//Log.Out("RebirthUtilities-OnUpdateLive skipItem: " + skipItem);
//Log.Out("RebirthUtilities-OnUpdateLive itemStack.IsEmpty(): " + itemStack.IsEmpty());
if (!itemStack.IsEmpty() && !skipItem)
{
//Log.Out("RebirthUtilities-OnUpdateLive B item name: " + itemStack.itemValue.ItemClass.GetItemName());
//Log.Out("RebirthUtilities-OnUpdateLive B itemStack.count: " + itemStack.count);
//Log.Out("RebirthUtilities-OnUpdateLive itemStack.itemValue.Modifications.Length: " + itemStack.itemValue.Modifications.Length);
//Log.Out("RebirthUtilities-OnUpdateLive itemStack.itemValue.CosmeticMods.Length: " + itemStack.itemValue.CosmeticMods.Length);
Recipe scrapableRecipe = CraftingManager.GetScrapableRecipe(itemStack.itemValue, itemStack.count);
bool dontScrap = (
itemStack.itemValue.ItemClass.Name == "apparelRunningShoesHP" ||
itemStack.itemValue.ItemClass.Name == "apparelCoatJacketLetterZU" ||
itemStack.itemValue.ItemClass.Name.ToLower().Contains("qt_")
);
if (scrapableRecipe != null && !dontScrap)
{
ItemClass forId = ItemClass.GetForId(scrapableRecipe.itemValueType);
ItemClass forId2 = ItemClass.GetForId(itemStack.itemValue.type);
//Log.Out("RebirthUtilities-OnUpdateLive forId.GetWeight(): " + forId.GetWeight());
//Log.Out("RebirthUtilities-OnUpdateLive forId2.GetWeight(): " + forId2.GetWeight());
int num = forId2.GetWeight() * itemStack.count;
//Log.Out("RebirthUtilities-OnUpdateLive num: " + num);
int weight = forId.GetWeight();
int num2 = num / weight;
int num3 = (int)((float)(num2 * weight) / (float)forId2.GetWeight() + 0.5f);
//Log.Out("RebirthUtilities-OnUpdateLive num3: " + num3);
num2 = (int)((float)num2 * 0.75f);
if (num2 <= 0)
{
num2 = 1;
}
ItemValue itemRecipeValue = ItemClass.GetItem(scrapableRecipe.GetOutputItemClass().GetItemName(), false);
ItemStack itemRecipeStack = new ItemStack(itemRecipeValue, num2);
if (!isPlayer && (itemRecipeValue.ItemClass.Name == "resourceCloth" ||
itemRecipeValue.ItemClass.Name == "resourceLeather"
))
{
//Log.Out("RebirthUtilities-OnUpdateLive SKIP B ");
}
//Log.Out("RebirthUtilities-OnUpdateLive scrapableRecipe.GetOutputItemClass().GetItemName(): " + scrapableRecipe.GetOutputItemClass().GetItemName());
//Log.Out("RebirthUtilities-OnUpdateLive num2: " + num2);
//Log.Out("RebirthUtilities-OnUpdateLive A Item Name: " + itemRecipeStack.itemValue.ItemClass.GetItemName());
//Log.Out("RebirthUtilities-OnUpdateLive A Item Count: " + itemRecipeStack.count);
if (!skipItem)
{
//Log.Out("RebirthUtilities-OnUpdateLive IS PLAYER A");
addItems = RebirthUtilities.AddPlayerItem(this.entityPlayer, this.lootContainer.GetClrIdx(), itemRecipeStack, true, true, true);
if (addItems)
{
if (this.entityPlayer.entityId == primaryPlayer.entityId)
{
//Log.Out("RebirthUtilities-OnUpdateLive B itemRecipeStack.count: " + itemRecipeStack.itemValue.ItemClass.Name);
//Log.Out("RebirthUtilities-OnUpdateLive B itemRecipeStack.count: " + num2);
primaryPlayer.PlayerUI.xui.CollectedItemList.AddItemStack(new ItemStack(itemRecipeStack.itemValue, num2), false);
}
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive B this.entityPlayer.entityId == primaryPlayer.entityId");
}
}
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive D Item Name: " + itemStack.itemValue.ItemClass.GetItemName());
//Log.Out("RebirthUtilities-OnUpdateLive D Item Count: " + itemStack.count);
int numItems = itemStack.count;
//Log.Out("RebirthUtilities-OnUpdateLive IS PLAYER C");
addItems = RebirthUtilities.AddPlayerItem(this.entityPlayer, this.lootContainer.GetClrIdx(), itemStack, true, true, true);
if (addItems)
{
if (this.entityPlayer.entityId == primaryPlayer.entityId)
{
//Log.Out("RebirthUtilities-OnUpdateLive D itemRecipeStack.count: " + itemStack.itemValue.ItemClass.Name);
//Log.Out("RebirthUtilities-OnUpdateLive D itemRecipeStack.count: " + numItems);
primaryPlayer.PlayerUI.xui.CollectedItemList.AddItemStack(new ItemStack(itemStack.itemValue, numItems), false);
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive D this.entityPlayer.entityId == primaryPlayer.entityId");
}
}
}
//Log.Out("RebirthUtilities-OnUpdateLive SET STACK TO EMPTY i: " + i);
this.lootContainer.items[i] = ItemStack.Empty.Clone();
this.lootContainer.SetModified();
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive STACK IS EMPTY i: " + i);
this.lootContainer.items[i] = ItemStack.Empty.Clone();
this.lootContainer.SetModified();
}
}
if (addItems)
{
//Log.Out("RebirthUtilities-OnUpdateLive PICK UP");
Manager.PlayInsidePlayerHead("item_pickup");
//Log.Out("RebirthUtilities-OnUpdateLive REMOVED BAG: " + this.EntityClass.entityClassName);
this.lootContainer.SetEmpty();
this.lootContainer.SetModified();
this.MarkToUnload();
this.KillLootContainer();
}
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive NO MOD TO GATHER LOOT");
}
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive E1, entityClassName: " + this.EntityClass.entityClassName);
}
}
}
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive NO LOOT CONTAINER");
string lootList = this.GetLootList();
if (!string.IsNullOrEmpty(lootList))
{
this.lootContainer = new TileEntityLootContainer((Chunk)null);
this.lootContainer.entityId = this.entityId;
this.lootContainer.lootListName = lootList;
//Log.Out("RebirthUtilities-OnUpdateLive lootList: " + lootList);
this.lootContainer.SetContainerSize(LootContainer.GetLootContainer(lootList, true).size, true);
}
if (!removedParticles)
{
RebirthUtilities.RemoveCommonParticles(this);
removedParticles = true;
}
}
}
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer && this.lootContainer != null && this.lootContainer.bTouched && this.lootContainer.IsEmpty())
{
//Log.Out("RebirthUtilities-OnUpdateLive F3");
this.MarkToUnload();
this.KillLootContainer();
}
}
else
{
AccumulatedTicksDead = GameTimer.Instance.ticks;
float flNotified = this.Buffs.GetCustomVar("$FR_ENTITY_NotifiedEvent");
if (flNotified == 1)
{
hasNotified = true;
}
//Log.Out("RebirthUtilities-OnUpdateLive Entity: " + this.EntityClass.entityClassName);
string rebirthPOISense = RebirthVariables.customPOISense;
int currentDay = GameUtils.WorldTimeToDays(GameManager.Instance.World.worldTime);
bool isValidPOISense = (rebirthPOISense == "always") ||
(GameManager.Instance.World.IsDaytime() && rebirthPOISense == "dayonly") ||
(!GameManager.Instance.World.IsDaytime() && rebirthPOISense == "nightonly");
if (this.IsSleeping && isValidPOISense)
{
this.ConditionalTriggerSleeperWakeUp();
}
if (this.attackTarget)
{
//Log.Out("RebirthUtilities-OnUpdateLive Target: " + this.attackTarget.EntityClass.entityClassName);
//Log.Out("RebirthUtilities-OnUpdateLive A this.EntityTags.ToString(): " + this.EntityTags.ToString());
//Log.Out("RebirthUtilities-OnUpdateLive A otherTags: " + this.otherTags);
//Log.Out("RebirthUtilities-OnUpdateLive hasNotified: " + hasNotified);
//Log.Out("RebirthUtilities-OnUpdateLive this.HasAllTags(boss,eventspawn): " + this.HasAllTags(FastTags<TagGroup.Global>.Parse("boss,eventspawn")));
bool hasEventTag = this.HasAllTags(FastTags<TagGroup.Global>.Parse("boss,eventspawn"));
//Log.Out("RebirthUtilities-OnUpdateLive hasEventTag: " + hasEventTag);
if (!hasNotified && hasEventTag)
{
hasNotified = true;
this.Buffs.SetCustomVar("$FR_ENTITY_NotifiedEvent", 1);
this.attackTarget.Buffs.AddBuff("FuriousRamsayEventTrigger");
}
float flRespawned = this.attackTarget.Buffs.GetCustomVar("$FR_NPC_Respawn");
if (flRespawned == 1)
{
this.SetRevengeTarget((EntityAlive) null);
this.attackTarget = null;
this.ClearInvestigatePosition();
}
float flMisery = this.Buffs.GetCustomVar("$FR_Zombie_Misery");
if (flMisery == 0 && !GameUtils.IsPlaytesting() && !RebirthUtilities.ScenarioSkip())
{
//Log.Out("RebirthUtilities-OnUpdateLive flMisery 1");
if (this.attackTarget is EntityPlayer)
{
//Log.Out("RebirthUtilities-OnUpdateLive flMisery 2");
bool hasParticles = false;
//Log.Out("RebirthUtilities-OnUpdateLive Target: " + this.attackTarget.EntityClass.entityClassName);
float progressionLevel = 0;
ProgressionValue progressionValue = this.attackTarget.Progression.GetProgressionValue("FuriousRamsayNaturalSelection");
if (progressionValue != null)
{
progressionLevel = progressionValue.Level;
}
bool isNaturalSelectionOn = RebirthUtilities.IsNaturalSelectionOn();
//Log.Out("RebirthUtilities-OnUpdateLive isNaturalSelectionOn: " + isNaturalSelectionOn);
if (!isNaturalSelectionOn)
{
progressionLevel = 0;
}
if (progressionLevel > 0)
{
//Log.Out("RebirthUtilities-OnUpdateLive flMisery 3");
string strProgressionLevel = progressionLevel.ToString();
if (progressionLevel < 10)
{
strProgressionLevel = "0" + strProgressionLevel;
}
float percentageAdd = progressionLevel / 20;
this.Buffs.SetCustomVar("$varFuriousRamsayPercentageAdd", percentageAdd);
this.Buffs.SetCustomVar("$varFuriousRamsayPercentageAddx4", percentageAdd * 4);
float addHealth = this.GetMaxHealth() * percentageAdd * 4;
this.Buffs.SetCustomVar("$BonusMaxHealth_FR", addHealth);
this.Buffs.SetCustomVar("$BonusHealth_FR", addHealth - 25);
//Log.Out("RebirthUtilities-OnUpdateLive progressionLevel this.Health: " + this.Health);
//Log.Out("RebirthUtilities-OnUpdateLive progressionLevel addHealth: " + addHealth);
//Log.Out("RebirthUtilities-OnUpdateLive progressionLevel $varFuriousRamsayPercentageAdd: " + percentageAdd);
//Log.Out("RebirthUtilities-OnUpdateLive progressionLevel (PLAYER KILLS): " + progressionLevel);
//Log.Out("RebirthUtilities-OnUpdateLive 10 * progressionLevel: " + (10 * progressionLevel));
float random = (float)this.rand.RandomRange(0, 100 + 1);
float levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills HealthMax");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "HealthMax");
//this.Stats.Health.BaseMax = this.Stats.Health.BaseMax + (int)addHealth;
//this.AddHealth((int)addHealth);
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills HealthBoost");
this.Buffs.AddBuff("FuriousRamsayGrowStrongerHealthBoostTier" + strProgressionLevel);
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills EntityDamage");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "EntityDamage");
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills BlockDamage");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "BlockDamage");
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills JumpStrength");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "JumpStrength");
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills WalkSpeed");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "WalkSpeed");
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills RunSpeed");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "RunSpeed");
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills Mobility");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "Mobility");
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills MovementFactorMultiplier");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "MovementFactorMultiplier");
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 10 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills AttacksPerMinute");
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerTierKills" + strProgressionLevel + "AttacksPerMinute");
}
this.Buffs.SetCustomVar("$FR_Zombie_Misery", 1f);
}
hasParticles = this.HasAnyTags(FastTags<TagGroup.Global>.Parse("hasparticle"));
//Log.Out("RebirthUtilities-OnUpdateLive hasParticles: " + hasParticles);
if (!this.HasAnyTags(FastTags<TagGroup.Global>.Parse("animal")) && !hasParticles && !particlesSet)
{
float random = (float)this.rand.RandomRange(0, 100 + 1);
//Log.Out("RebirthUtilities-OnUpdateLive biome random A: " + random);
if (random <= 10)
{
//Log.Out("RebirthUtilities-OnUpdateLive biome 1");
string otherTags = this.otherTags;
string biomeName = RebirthUtilities.GetBiomeName(this);
if (biomeName == "wasteland")
{
this.Buffs.AddBuff("HandParticles11");
otherTags = otherTags + ",explosionresist,smokeimmunezombie,fireresist,fireimmunezombie,shockresist,shockimmunezombie";
this.lootListOnDeath = "FuriousRamsay881";
this.SetEntityName("ttZombieFireShockSmoke");
particlesSet = true;
}
else if (biomeName == "desert")
{
this.Buffs.AddBuff("HandParticles1");
otherTags = otherTags + ",fireresist,fireimmunezombie";
this.lootListOnDeath = "FuriousRamsay877";
this.SetEntityName("ttZombieFire");
particlesSet = true;
}
else if (biomeName == "forest" || biomeName == "pine_forest")
{
this.Buffs.AddBuff("HandParticles10");
otherTags = otherTags + ",explosionresist,smokeimmunezombie";
this.lootListOnDeath = "FuriousRamsay880";
this.SetEntityName("ttZombieSmoke");
particlesSet = true;
}
else if (biomeName == "burnt_forest")
{
this.Buffs.AddBuff("HandParticles1");
otherTags = otherTags + ",fireresist,fireimmunezombie";
this.lootListOnDeath = "FuriousRamsay877";
this.SetEntityName("ttZombieFire");
particlesSet = true;
}
else if (biomeName == "snow")
{
this.Buffs.AddBuff("HandParticles2");
otherTags = otherTags + ",shockresist,shockimmunezombie";
this.lootListOnDeath = "FuriousRamsay878";
this.SetEntityName("ttZombieShock");
particlesSet = true;
}
this.otherTags = otherTags;
//Log.Out("RebirthUtilities-OnUpdateLive D this.EntityTags.ToString(): " + this.EntityTags.ToString());
//Log.Out("RebirthUtilities-OnUpdateLive D this.otherTags: " + this.otherTags);
}
else
{
random = (float)this.rand.RandomRange(1, 100);
//Log.Out("RebirthUtilities-OnUpdateLive biome random B: " + random);
if (random <= 2)
{
this.Buffs.AddBuff("HandParticles4");
this.SetEntityName("ttZombieToxic");
}
}
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer && !SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
{
//Log.Out("RebirthUtilities-OnUpdateLive SendPackage this.entityId: " + this.entityId);
//Log.Out("RebirthUtilities-OnUpdateLive SendPackage this.otherTags: " + this.otherTags);
SingletonMonoBehaviour<ConnectionManager>.Instance.SendPackage(NetPackageManager.GetPackage<NetPackageSynchZombieInfoRebirth>().Setup(this.entityId, this.otherTags, this.entityName, this.lootListOnDeath), false, -1, -1, -1, null, 192);
}
}
progressionLevel = 0;
progressionValue = this.attackTarget.Progression.GetProgressionValue("FuriousRamsayAscension");
if (progressionValue != null)
{
progressionLevel = progressionValue.Level;
}
bool isAscensionOn = RebirthVariables.customAscension;
if (!isAscensionOn)
{
progressionLevel = 0;
}
if (progressionLevel > 0 && !particlesSet && !hasParticles)
{
//Log.Out("RebirthUtilities-OnUpdateLive flMisery 4");
string strProgressionLevel = progressionLevel.ToString();
if (progressionLevel < 10)
{
strProgressionLevel = "0" + strProgressionLevel;
}
float random = (float)this.rand.RandomRange(0, 100 + 1);
float randomElement = 0;
if (progressionLevel < 3)
{
randomElement = 0;
}
if (progressionLevel == 3)
{
randomElement = 1;
}
if (progressionLevel == 4)
{
randomElement = (float)this.rand.RandomRange(1, 3);
}
if (progressionLevel == 5)
{
randomElement = (float)this.rand.RandomRange(1, 6);
}
if (progressionLevel == 6)
{
if (isHordeNight)
{
randomElement = (float)this.rand.RandomRange(1, 9);
}
else
{
randomElement = (float)this.rand.RandomRange(1, 6);
}
}
if (progressionLevel >= 7)
{
if (isHordeNight)
{
randomElement = (float)this.rand.RandomRange(1, 9);
}
else
{
randomElement = (float)this.rand.RandomRange(1, 9);
}
}
//Log.Out("RebirthUtilities-OnUpdateLive progressionLevel (ASCENSION LEVEL): " + progressionLevel);
//Log.Out("RebirthUtilities-OnUpdateLive 5 * progressionLevel: " + (5 * progressionLevel));
//Log.Out("RebirthUtilities-OnUpdateLive randomElement: " + randomElement);
this.Buffs.SetCustomVar("$FuriousRamsayElement", randomElement);
if (randomElement == 1 || randomElement == 3 || randomElement == 5 || randomElement == 7)
{
this.Buffs.SetCustomVar("$FuriousRamsayElementFire", 1f);
}
float levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 5 * progressionLevel)
{
//Log.Out("RebirthUtilities-OnUpdateLive Kills SpeedBurst");
if (!this.HasAnyTags(FastTags<TagGroup.Global>.Parse("feral")))
{
this.Buffs.AddBuff("FuriousRamsaySpeedBurstTimerLevel" + strProgressionLevel);
}
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
//Log.Out("RebirthUtilities-OnUpdateLive B this.EntityTags.ToString(): " + this.EntityTags.ToString());
//Log.Out("RebirthUtilities-OnUpdateLive B this.otherTags: " + this.otherTags);
//Log.Out("RebirthUtilities-OnUpdateLive HasParticle: " + this.otherTags.Contains("hasparticle"));
//Log.Out("RebirthUtilities-OnUpdateLive HasParticle: " + hasParticles);
if (levelRandom < 5 * progressionLevel && randomElement > 0 & !hasParticles)
{
//Log.Out("RebirthUtilities-OnUpdateLive HAS ELEMENT: " + strProgressionLevel + "Buffs" + randomElement);
if (!this.HasAnyTags(FastTags<TagGroup.Global>.Parse("animal")))
{
if (!isHordeNight)
{
if (randomElement == 7)
{
randomElement = 5;
}
else if (randomElement == 8)
{
randomElement = 6;
}
else if (randomElement == 9)
{
randomElement = 10;
}
}
this.Buffs.AddBuff("HandParticles" + randomElement);
hasParticles = true;
//Log.Out("RebirthUtilities-OnUpdateLive : " + "HandParticles" + randomElement);
string otherTags = this.otherTags;
if (randomElement == 1)
{
otherTags = otherTags + ",fireresist,fireimmunezombie";
this.lootListOnDeath = "FuriousRamsay877";
this.SetEntityName("ttZombieFire");
}
else if (randomElement == 2)
{
otherTags = otherTags + ",shockresist,shockimmunezombie";
this.lootListOnDeath = "FuriousRamsay878";
this.SetEntityName("ttZombieShock");
}
else if (randomElement == 3)
{
otherTags = otherTags + ",fireresist,fireimmunezombie,shockresist,shockimmunezombie";
this.lootListOnDeath = "FuriousRamsay879";
this.SetEntityName("ttZombieFireShock");
}
else if (randomElement == 4)
{
// RADIATION
this.SetEntityName("ttZombieToxic");
}
else if (randomElement == 5)
{
// FIRE, RADIATION
otherTags = otherTags + ",fireresist,fireimmunezombie";
this.lootListOnDeath = "FuriousRamsay877";
this.SetEntityName("ttZombieToxicFire");
}
else if (randomElement == 6)
{
// SHOCK, RADIATION
otherTags = otherTags + ",shockresist,shockimmunezombie";
this.lootListOnDeath = "FuriousRamsay878";
this.SetEntityName("ttZombieToxicShock");
}
else if (randomElement == 7)
{
// FIRE, BLOCK DAMAGE
otherTags = otherTags + ",fireresist,fireimmunezombie";
this.lootListOnDeath = "FuriousRamsay877";
this.SetEntityName("ttZombiePowerFire");
}
else if (randomElement == 8)
{
// SHOCK, BLOCK DAMAGE
otherTags = otherTags + ",shockresist,shockimmunezombie";
this.lootListOnDeath = "FuriousRamsay878";
this.SetEntityName("ttZombiePowerShock");
}
else if (randomElement == 9)
{
// RADIATION, BLOCK DAMAGE
this.SetEntityName("ttZombiePowerToxic");
}
else if (randomElement == 10)
{
otherTags = otherTags + ",explosionresist,smokeimmunezombie";
this.lootListOnDeath = "FuriousRamsay880";
this.SetEntityName("ttZombieSmoke");
}
else if (randomElement == 11)
{
otherTags = otherTags + ",explosionresist,smokeimmunezombie,fireresist,fireimmunezombie,shockresist,shockimmunezombie";
this.lootListOnDeath = "FuriousRamsay881";
this.SetEntityName("ttZombieFireShockSmoke");
}
this.otherTags = otherTags;
//Log.Out("RebirthUtilities-OnUpdateLive C this.EntityTags.ToString(): " + this.EntityTags.ToString());
//Log.Out("RebirthUtilities-OnUpdateLive C this.otherTags: " + this.otherTags);
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer && !SingletonMonoBehaviour<ConnectionManager>.Instance.IsSinglePlayer)
{
//Log.Out("RebirthUtilities-OnUpdateLive SendPackage this.entityId: " + this.entityId);
//Log.Out("RebirthUtilities-OnUpdateLive SendPackage this.otherTags: " + this.otherTags);
SingletonMonoBehaviour<ConnectionManager>.Instance.SendPackage(NetPackageManager.GetPackage<NetPackageSynchZombieInfoRebirth>().Setup(this.entityId, this.otherTags, this.entityName, this.lootListOnDeath), false, -1, -1, -1, null, 192);
}
}
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 5 * progressionLevel)
{
if (progressionLevel >= 4)
{
//Log.Out("RebirthUtilities-OnUpdateLive OPENS DOORS");
this.Buffs.SetCustomVar("$varFuriousRamsayOpenDoors", 1f);
}
}
random = (float)this.rand.RandomRange(0, 100 + 1);
levelRandom = random * (progressionLevel / 10);
//Log.Out("RebirthUtilities-OnUpdateLive random: " + random);
//Log.Out("RebirthUtilities-OnUpdateLive levelRandom: " + levelRandom);
if (levelRandom < 5 * progressionLevel)
{
if (progressionLevel >= 6 && progressionLevel < 9)
{
//Log.Out("RebirthUtilities-OnUpdateLive JUMPS 1");
if (!this.HasAnyTags(FastTags<TagGroup.Global>.Parse("boss")))
{
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerZombieJump01");
}
}
else if (progressionLevel >= 9)
{
//Log.Out("RebirthUtilities-OnUpdateLive JUMPS 2");
if (!this.HasAnyTags(FastTags<TagGroup.Global>.Parse("boss")))
{
this.Buffs.AddBuff("FuriousRamsayTheyGrowStrongerZombieJump02");
}
}
}
this.Buffs.SetCustomVar("$FR_Zombie_Misery", 1f);
}
particlesSet = true;
}
}
}
else
{
//Log.Out("RebirthUtilities-OnUpdateLive NO ATTACK TARGET");
}
}
base.OnUpdateLive();
}
private int ticksUntilVisible = 2;
//private float moveSpeedRagePer;
//private float moveSpeedScaleTime;
//private float fallTime;
//private float fallThresholdTime;
//private bool disableFallBehaviorUntilOnGround;
//private bool bPlayHurtSound;
//private string soundLiving;
//private int soundLivingID = -1;
public int unloadAfterTime = 0;
//private string particleOnDeath;
//public bool bLastAttackReleased;
public EntityAlive targetEntity;
//private int attackTargetTime;
//private bool bJumping;
//private bool bClimbing;
public new bool hasAI;
//private bool isMoveDirAbsolute;
//private float proneRefillRate;
//private int ticksToCheckSeenByPlayer;
//private float proneRefillCounter;
//private float kneelRefillCounter;
//private float kneelRefillRate;
//private bool wasSeenByPlayer;
//private DynamicRagdollFlags _dynamicRagdoll;
//private Vector3 _dynamicRagdollRootMotion;
//private readonly List<Vector3> _ragdollPositionsPrev = new List<Vector3>();
//private readonly List<Vector3> _ragdollPositionsCur = new List<Vector3>();
//private BlockValue corpseBlockValue;
//private float corpseBlockChance;
public float flHandItemRangeMP = 0;
public float flMaxBaseJumpHeight = 1;
public float flMaxJumpHeight = 1;
public float flMaxJumpSize = 2;
public float flLeapMaxDistance = 5;
public bool hasNotified = false;
public int gamestageStart = 0;
public int gamestageEnd = 0;
public List<int> generatedNumbers = new List<int>();
public ulong AccumulatedTicksDead = 0UL;
public int entityThatKilledMeID = -1;
public EntityPlayer entityPlayer = null;
public bool particlesSet = false;
public string lootDropEntityClass = "";
public string otherTags = "";
public bool removedParticles = false;
public bool setSize = false;
public bool setNavIcon = false;
public int wanderingHorde = 0;
public float zombieModelLayerCheck = 0f;
public float zombieVerifyCheck = 0f;
Vector3i corpsePosition;
public long LastHit = 0L;
public EnumBodyPartHit dismemberedPart = EnumBodyPartHit.None;
}