Beispiel #1
0
        // Token: 0x060033AE RID: 13230 RVA: 0x0014F378 File Offset: 0x0014D778
        public void Explode()
        {
            List <EPlayerKill> list;

            DamageTool.explode(base.transform.position, this.range, EDeathCause.GRENADE, this.killer, this.playerDamage, this.zombieDamage, this.animalDamage, this.barricadeDamage, this.structureDamage, this.vehicleDamage, this.resourceDamage, this.objectDamage, out list, EExplosionDamageType.CONVENTIONAL, 32f, true, false);
            EffectManager.sendEffect(this.explosion, EffectManager.LARGE, base.transform.position);
            UnityEngine.Object.Destroy(base.gameObject);
        }
Beispiel #2
0
        // Token: 0x060020B4 RID: 8372 RVA: 0x000B363C File Offset: 0x000B1A3C
        public void detonate(CSteamID killer)
        {
            EffectManager.sendEffect(this.explosion2, EffectManager.LARGE, base.transform.position);
            List <EPlayerKill> list;

            DamageTool.explode(base.transform.position, this.range2, EDeathCause.CHARGE, killer, this.playerDamage, this.zombieDamage, this.animalDamage, this.barricadeDamage, this.structureDamage, this.vehicleDamage, this.resourceDamage, this.objectDamage, out list, EExplosionDamageType.CONVENTIONAL, 32f, true, false);
            BarricadeManager.damage(base.transform, 5f, 1f, false);
        }
Beispiel #3
0
 private void OnTriggerEnter(Collider other)
 {
     if (this.isExploded)
     {
         return;
     }
     if (other.isTrigger)
     {
         return;
     }
     if (other.transform == this.ignoreTransform)
     {
         return;
     }
     this.isExploded = true;
     if (Provider.isServer)
     {
         DamageTool.explode(this.lastPos, this.range, EDeathCause.MISSILE, this.killer, this.playerDamage, this.zombieDamage, this.animalDamage, this.barricadeDamage, this.structureDamage, this.vehicleDamage, this.resourceDamage, this.objectDamage, EExplosionDamageType.CONVENTIONAL, 32f, true);
         EffectManager.sendEffect(this.explosion, EffectManager.LARGE, this.lastPos);
     }
     Object.Destroy(base.gameObject);
 }
Beispiel #4
0
 // Token: 0x060033B3 RID: 13235 RVA: 0x0014F4CC File Offset: 0x0014D8CC
 private void OnTriggerEnter(Collider other)
 {
     if (this.isExploded)
     {
         return;
     }
     if (other.isTrigger)
     {
         return;
     }
     if (other.transform == this.ignoreTransform)
     {
         return;
     }
     this.isExploded = true;
     if (Provider.isServer)
     {
         Vector3            point        = this.lastPos;
         float              damageRadius = this.range;
         EDeathCause        cause        = EDeathCause.MISSILE;
         CSteamID           csteamID     = this.killer;
         float              num          = this.playerDamage;
         float              num2         = this.zombieDamage;
         float              num3         = this.animalDamage;
         float              num4         = this.barricadeDamage;
         float              num5         = this.structureDamage;
         float              num6         = this.vehicleDamage;
         float              num7         = this.resourceDamage;
         float              num8         = this.objectDamage;
         bool               flag         = this.penetrateBuildables;
         List <EPlayerKill> list;
         DamageTool.explode(point, damageRadius, cause, csteamID, num, num2, num3, num4, num5, num6, num7, num8, out list, EExplosionDamageType.CONVENTIONAL, 32f, true, flag);
         EffectManager.sendEffect(this.explosion, EffectManager.LARGE, this.lastPos);
     }
     UnityEngine.Object.Destroy(base.gameObject);
 }
 // Token: 0x06003953 RID: 14675 RVA: 0x001A8E8C File Offset: 0x001A728C
 public override void simulate(uint simulation, bool inputSteady)
 {
     if (this.isUsing && this.isUseable)
     {
         base.player.equipment.isBusy = false;
         this.isUsing = false;
         ItemConsumeableAsset itemConsumeableAsset = (ItemConsumeableAsset)base.player.equipment.asset;
         if (this.consumeMode == EConsumeMode.AID)
         {
             if (Provider.isServer)
             {
                 if (itemConsumeableAsset != null && this.enemy != null)
                 {
                     byte health     = this.enemy.life.health;
                     byte virus      = this.enemy.life.virus;
                     bool isBleeding = this.enemy.life.isBleeding;
                     bool isBroken   = this.enemy.life.isBroken;
                     this.enemy.life.askHeal((byte)((float)itemConsumeableAsset.health * (1f + base.player.skills.mastery(2, 0) * 0.5f)), itemConsumeableAsset.hasBleeding, itemConsumeableAsset.hasBroken);
                     byte food = this.enemy.life.food;
                     this.enemy.life.askEat((byte)((float)itemConsumeableAsset.food * ((float)base.player.equipment.quality / 100f)));
                     byte food2 = this.enemy.life.food;
                     byte b     = (byte)((float)itemConsumeableAsset.water * ((float)base.player.equipment.quality / 100f));
                     if (itemConsumeableAsset.foodConstrainsWater)
                     {
                         b = (byte)Mathf.Min((int)b, (int)(food2 - food));
                     }
                     this.enemy.life.askDrink(b);
                     this.enemy.life.askInfect((byte)((float)itemConsumeableAsset.virus * (1f - this.enemy.skills.mastery(1, 2) * 0.5f)));
                     this.enemy.life.askDisinfect((byte)((float)itemConsumeableAsset.disinfectant * (1f + this.enemy.skills.mastery(2, 0) * 0.5f)));
                     if (base.player.equipment.quality < 50)
                     {
                         this.enemy.life.askInfect((byte)((float)(itemConsumeableAsset.food + itemConsumeableAsset.water) * 0.5f * (1f - (float)base.player.equipment.quality / 50f) * (1f - this.enemy.skills.mastery(1, 2) * 0.5f)));
                     }
                     byte health2     = this.enemy.life.health;
                     byte virus2      = this.enemy.life.virus;
                     bool isBleeding2 = this.enemy.life.isBleeding;
                     bool isBroken2   = this.enemy.life.isBroken;
                     uint num         = 0u;
                     int  num2        = 0;
                     if (health2 > health)
                     {
                         num += (uint)Mathf.RoundToInt((float)(health2 - health) / 2f);
                         num2++;
                     }
                     if (virus2 > virus)
                     {
                         num += (uint)Mathf.RoundToInt((float)(virus2 - virus) / 2f);
                         num2++;
                     }
                     if (isBleeding && !isBleeding2)
                     {
                         num += 15u;
                         num2++;
                     }
                     if (isBroken && !isBroken2)
                     {
                         num += 15u;
                         num2++;
                     }
                     if (num > 0u)
                     {
                         base.player.skills.askPay(num);
                     }
                     if (num2 > 0)
                     {
                         base.player.skills.askRep(num2);
                     }
                 }
                 base.player.equipment.use();
             }
         }
         else
         {
             if (itemConsumeableAsset != null)
             {
                 base.player.life.askRest(itemConsumeableAsset.energy);
                 base.player.life.askView((byte)((float)itemConsumeableAsset.vision * (1f - base.player.skills.mastery(1, 2))));
                 base.player.life.askWarm(itemConsumeableAsset.warmth);
                 bool flag;
                 if (base.channel.isOwner && itemConsumeableAsset.vision > 0 && Provider.provider.achievementsService.getAchievement("Berries", out flag) && !flag)
                 {
                     Provider.provider.achievementsService.setAchievement("Berries");
                 }
             }
             if (Provider.isServer)
             {
                 Vector3 point = base.transform.position + Vector3.up;
                 if (itemConsumeableAsset != null)
                 {
                     base.player.life.askHeal((byte)((float)itemConsumeableAsset.health * (1f + base.player.skills.mastery(2, 0) * 0.5f)), itemConsumeableAsset.hasBleeding, itemConsumeableAsset.hasBroken);
                     byte food3 = base.player.life.food;
                     base.player.life.askEat((byte)((float)itemConsumeableAsset.food * ((float)base.player.equipment.quality / 100f)));
                     byte food4 = base.player.life.food;
                     byte b2    = (byte)((float)itemConsumeableAsset.water * ((float)base.player.equipment.quality / 100f));
                     if (itemConsumeableAsset.foodConstrainsWater)
                     {
                         b2 = (byte)Mathf.Min((int)b2, (int)(food4 - food3));
                     }
                     base.player.life.askDrink(b2);
                     base.player.life.askInfect((byte)((float)itemConsumeableAsset.virus * (1f - base.player.skills.mastery(1, 2) * 0.5f)));
                     base.player.life.askDisinfect((byte)((float)itemConsumeableAsset.disinfectant * (1f + base.player.skills.mastery(2, 0) * 0.5f)));
                     base.player.life.askWarm(itemConsumeableAsset.warmth);
                     if (base.player.equipment.quality < 50)
                     {
                         base.player.life.askInfect((byte)((float)(itemConsumeableAsset.food + itemConsumeableAsset.water) * 0.5f * (1f - (float)base.player.equipment.quality / 50f) * (1f - base.player.skills.mastery(1, 2) * 0.5f)));
                     }
                 }
                 base.player.equipment.use();
                 if (itemConsumeableAsset != null && itemConsumeableAsset.explosion > 0)
                 {
                     EffectManager.sendEffect(itemConsumeableAsset.explosion, EffectManager.LARGE, point);
                     List <EPlayerKill> list;
                     DamageTool.explode(point, itemConsumeableAsset.range, EDeathCause.CHARGE, base.channel.owner.playerID.steamID, itemConsumeableAsset.playerDamageMultiplier.damage, itemConsumeableAsset.zombieDamageMultiplier.damage, itemConsumeableAsset.animalDamageMultiplier.damage, itemConsumeableAsset.barricadeDamage, itemConsumeableAsset.structureDamage, itemConsumeableAsset.vehicleDamage, itemConsumeableAsset.resourceDamage, itemConsumeableAsset.objectDamage, out list, EExplosionDamageType.CONVENTIONAL, 32f, true, false);
                     if (itemConsumeableAsset.playerDamageMultiplier.damage > 0.5f)
                     {
                         EPlayerKill eplayerKill;
                         base.player.life.askDamage(101, Vector3.up, EDeathCause.CHARGE, ELimb.SPINE, base.channel.owner.playerID.steamID, out eplayerKill);
                     }
                 }
             }
         }
     }
 }
Beispiel #6
0
 // Token: 0x06002219 RID: 8729 RVA: 0x000BB8A8 File Offset: 0x000B9CA8
 private void OnTriggerEnter(Collider other)
 {
     if (other.isTrigger)
     {
         return;
     }
     if (Time.realtimeSinceStartup - this.lastActive < 0.25f)
     {
         return;
     }
     if (other.transform == base.transform.parent)
     {
         return;
     }
     if (Provider.isServer)
     {
         if (this.isExplosive)
         {
             if (other.transform.CompareTag("Player"))
             {
                 if (Provider.isPvP && !other.transform.parent.CompareTag("Vehicle"))
                 {
                     EffectManager.sendEffect(this.explosion2, EffectManager.LARGE, base.transform.position);
                     List <EPlayerKill> list;
                     DamageTool.explode(base.transform.position, this.range2, EDeathCause.LANDMINE, CSteamID.Nil, this.playerDamage, this.zombieDamage, this.animalDamage, this.barricadeDamage, this.structureDamage, this.vehicleDamage, this.resourceDamage, this.objectDamage, out list, EExplosionDamageType.CONVENTIONAL, 32f, true, false);
                 }
             }
             else
             {
                 EffectManager.sendEffect(this.explosion2, EffectManager.LARGE, base.transform.position);
                 List <EPlayerKill> list2;
                 DamageTool.explode(base.transform.position, this.range2, EDeathCause.LANDMINE, CSteamID.Nil, this.playerDamage, this.zombieDamage, this.animalDamage, this.barricadeDamage, this.structureDamage, this.vehicleDamage, this.resourceDamage, this.objectDamage, out list2, EExplosionDamageType.CONVENTIONAL, 32f, true, false);
             }
         }
         else if (other.transform.CompareTag("Player"))
         {
             if (Provider.isPvP && !other.transform.parent.CompareTag("Vehicle"))
             {
                 Player player = DamageTool.getPlayer(other.transform);
                 if (player != null)
                 {
                     EPlayerKill eplayerKill;
                     DamageTool.damage(player, EDeathCause.SHRED, ELimb.SPINE, CSteamID.Nil, Vector3.up, this.playerDamage, 1f, out eplayerKill);
                     if (this.isBroken)
                     {
                         player.life.breakLegs();
                     }
                     EffectManager.sendEffect(5, EffectManager.SMALL, base.transform.position + Vector3.up, Vector3.down);
                     BarricadeManager.damage(base.transform.parent, 5f, 1f, false);
                 }
             }
         }
         else if (other.transform.CompareTag("Agent"))
         {
             Zombie zombie = DamageTool.getZombie(other.transform);
             if (zombie != null)
             {
                 EPlayerKill eplayerKill2;
                 uint        num;
                 DamageTool.damage(zombie, base.transform.forward, this.zombieDamage, 1f, out eplayerKill2, out num);
                 EffectManager.sendEffect((!zombie.isRadioactive) ? 5 : 95, EffectManager.SMALL, base.transform.position + Vector3.up, Vector3.down);
                 BarricadeManager.damage(base.transform.parent, (!zombie.isHyper) ? 5f : 10f, 1f, false);
             }
             else
             {
                 Animal animal = DamageTool.getAnimal(other.transform);
                 if (animal != null)
                 {
                     EPlayerKill eplayerKill3;
                     uint        num2;
                     DamageTool.damage(animal, base.transform.forward, this.animalDamage, 1f, out eplayerKill3, out num2);
                     EffectManager.sendEffect(5, EffectManager.SMALL, base.transform.position + Vector3.up, Vector3.down);
                     BarricadeManager.damage(base.transform.parent, 5f, 1f, false);
                 }
             }
         }
     }
 }