本文整理汇总了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;
}
示例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());
}
示例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);
}
}