Example #1
0
        protected override bool TryCastShot()
        {
            if (currentTarget.HasThing && currentTarget.Thing.Map != caster.Map)
            {
                return(false);
            }
            PowerBeam obj = (PowerBeam)GenSpawn.Spawn(ThingDefOf.PowerBeam, currentTarget.Cell, caster.Map);

            obj.duration   = 600;
            obj.instigator = caster;
            obj.weaponDef  = ((base.EquipmentSource != null) ? base.EquipmentSource.def : null);
            obj.StartStrike();
            base.ReloadableCompSource?.UsedOnce();
            return(true);
        }
Example #2
0
		protected override bool TryCastShot()
		{
			if (this.currentTarget.HasThing && this.currentTarget.Thing.Map != this.caster.Map)
			{
				return false;
			}
			PowerBeam powerBeam = (PowerBeam)GenSpawn.Spawn(ThingDefOf.PowerBeam, this.currentTarget.Cell, this.caster.Map);
			powerBeam.duration = 600;
			powerBeam.instigator = this.caster;
			powerBeam.weaponDef = ((this.ownerEquipment == null) ? null : this.ownerEquipment.def);
			powerBeam.StartStrike();
			if (this.ownerEquipment != null && !this.ownerEquipment.Destroyed)
			{
				this.ownerEquipment.Destroy(DestroyMode.Vanish);
			}
			return true;
		}
Example #3
0
        protected override bool TryCastShot()
        {
            if (this.currentTarget.HasThing && this.currentTarget.Thing.Map != this.caster.Map)
            {
                return(false);
            }
            PowerBeam powerBeam = (PowerBeam)GenSpawn.Spawn(ThingDefOf.PowerBeam, this.currentTarget.Cell, this.caster.Map, WipeMode.Vanish);

            powerBeam.duration   = 600;
            powerBeam.instigator = this.caster;
            powerBeam.weaponDef  = ((base.EquipmentSource == null) ? null : base.EquipmentSource.def);
            powerBeam.StartStrike();
            if (base.EquipmentSource != null && !base.EquipmentSource.Destroyed)
            {
                base.EquipmentSource.Destroy(DestroyMode.Vanish);
            }
            return(true);
        }