当前位置: 首页>>代码示例>>C#>>正文


C# Thing.TryAttachFire方法代码示例

本文整理汇总了C#中Thing.TryAttachFire方法的典型用法代码示例。如果您正苦于以下问题:C# Thing.TryAttachFire方法的具体用法?C# Thing.TryAttachFire怎么用?C# Thing.TryAttachFire使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Thing的用法示例。


在下文中一共展示了Thing.TryAttachFire方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Ignite

 private Toil Ignite(Thing target)
 {
     Toil toil = new Toil();
     toil.initAction = delegate
     {
         Pawn feenix = this.pawn;
         if (target.FlammableNow && !target.IsBurning())
         {
             if (target.CanEverAttachFire())
             {
                 target.TryAttachFire(1f);
             }
             else
             {
                 FireUtility.TryStartFireIn(target.Position, 1f);
             }
             PawnUtility.ForceWait(feenix, 250, target);
         }
         else
         {
             return;
         }
     };
     toil.defaultCompleteMode = ToilCompleteMode.Delay;
     toil.defaultDuration = 250;
     return toil;
 }
开发者ID:FluffierThanThou,项目名称:RW_Cats,代码行数:27,代码来源:JobDriver_IgniteFire.cs

示例2: Impact

 protected override void Impact(Thing hitThing)
 {
     base.Impact(hitThing);
     if (hitThing != null)
     {
         hitThing.TryAttachFire(0.2f);
     }
     else
     {
         GenSpawn.Spawn(ThingDef.Named("FilthFuel"), base.Position);
         FireUtility.TryStartFireIn(base.Position, 0.2f);
     }
     MoteMaker.MakeStaticMote(this.Position, ThingDefOf.Mote_ShotFlash, 6f);
     MoteMaker.ThrowMicroSparks(base.Position.ToVector3Shifted());
 }
开发者ID:Skullywag,项目名称:FlameWeapons,代码行数:15,代码来源:Projectile_Flame.cs

示例3: Impact

 /// <summary>
 /// Impacts a pawn/object or the ground.
 /// </summary>
 protected override void Impact(Thing hitThing)
 {
     base.Impact(hitThing);
     if (hitThing != null)
     {
         int damageAmountBase = this.def.projectile.damageAmountBase;
         BodyPartDamageInfo value = new BodyPartDamageInfo(null, null);
         DamageInfo dinfo = new DamageInfo(this.def.projectile.damageDef, damageAmountBase, this.launcher, this.ExactRotation.eulerAngles.y, new BodyPartDamageInfo?(value), this.equipmentDef);
         hitThing.TakeDamage(dinfo);
         Pawn pawn = hitThing as Pawn;
         if (pawn != null && !pawn.Downed && Rand.Value < Projectile_Plasma.burnChance)
         {
             MoteThrower.ThrowMicroSparks(this.destination);
             hitThing.TryAttachFire(0.1f);
         }
     }
     else
     {
         SoundDefOf.BulletImpactGround.PlayOneShot(base.Position);
         MoteThrower.ThrowStatic(this.ExactPosition, ThingDefOf.Mote_ShotHit_Dirt, 1f);
         ThrowMicroSparksGreen(this.ExactPosition);
     }
 }
开发者ID:Skullywag,项目名称:PlasmaWeapons,代码行数:26,代码来源:Projectile_Plasma.cs


注:本文中的Thing.TryAttachFire方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。