diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.dll b/1.6/1.6/Assemblies/WulaFallenEmpire.dll index 3a570728..d1fb5bb0 100644 Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.dll and b/1.6/1.6/Assemblies/WulaFallenEmpire.dll differ diff --git a/1.6/1.6/Defs/ThingDefs_Misc/Weapons/WULA_Ionic_Weapons.xml b/1.6/1.6/Defs/ThingDefs_Misc/Weapons/WULA_Ionic_Weapons.xml index 5420b06d..01bff741 100644 --- a/1.6/1.6/Defs/ThingDefs_Misc/Weapons/WULA_Ionic_Weapons.xml +++ b/1.6/1.6/Defs/ThingDefs_Misc/Weapons/WULA_Ionic_Weapons.xml @@ -59,20 +59,14 @@ true 25.9 1.5 - 10 - 12 + 3 + 50 ChargeLance_Fire GunTail_Heavy true - 0.7 - 0.6 - 0.5 - 0.4 - 3 - true - 2.5 + 1.5 Vaporize 50 0.3 diff --git a/Source/WulaFallenEmpire/Thing_ExcaliburBeam.cs b/Source/WulaFallenEmpire/Thing_ExcaliburBeam.cs index ceb7be7b..984fb416 100644 --- a/Source/WulaFallenEmpire/Thing_ExcaliburBeam.cs +++ b/Source/WulaFallenEmpire/Thing_ExcaliburBeam.cs @@ -42,10 +42,18 @@ namespace WulaFallenEmpire public void StartStrike(List allCells, int burstIndex, int totalBursts) { - currentBurstCells = allCells; + if (allCells == null || !allCells.Any()) + { + Destroy(); + return; + } + + currentBurstCells = new List(allCells); currentBurstShot = burstIndex; burstShotsTotal = totalBursts; - ticksToDetonate = 1; // Start detonation immediately + + // Add a small delay before detonation for visual effect + ticksToDetonate = 10; // 10 ticks delay before detonation } protected override void TimeInterval(float deltaTime) @@ -63,35 +71,81 @@ namespace WulaFallenEmpire private void Detonate() { - if (currentBurstCells == null || !currentBurstCells.Any()) + if (currentBurstCells == null || !currentBurstCells.Any() || Map == null) { Destroy(); return; } - // For this burst, we'll detonate all cells - foreach (IntVec3 cell in currentBurstCells) + // Create a copy of the list to avoid modification during iteration + List cellsToDetonate = new List(currentBurstCells); + + // Clear the current burst cells to prevent reuse + currentBurstCells.Clear(); + + foreach (IntVec3 cell in cellsToDetonate) { if (cell.InBounds(Map)) { // Apply explosion effect, but ignore the caster - List ignoredThings = new List { caster }; + List ignoredThings = new List(); + if (caster != null) + { + ignoredThings.Add(caster); + } + DamageDef explosionDamageType = damageDef ?? DamageDefOf.Bomb; - GenExplosion.DoExplosion(center: cell, map: Map, radius: 0.9f, damType: explosionDamageType, instigator: caster, - damAmount: (int)damageAmount, armorPenetration: armorPenetration, - explosionSound: null, weapon: weaponDef, projectile: null, - intendedTarget: null, postExplosionSpawnThingDef: null, - postExplosionSpawnChance: 0f, postExplosionSpawnThingCount: 1, - postExplosionGasType: null, applyDamageToExplosionCellsNeighbors: false, - preExplosionSpawnThingDef: null, preExplosionSpawnChance: 0f, - preExplosionSpawnThingCount: 1, chanceToStartFire: 0f, - damageFalloff: false, direction: null, ignoredThings: ignoredThings, - affectedAngle: null, doVisualEffects: true, propagationSpeed: 0f, - screenShakeFactor: 0f, doSoundEffects: true, postExplosionSpawnThingDefWater: null, - flammabilityChanceCurve: null, overrideCells: null, postExplosionSpawnSingleThingDef: null, preExplosionSpawnSingleThingDef: null); + + // Create explosion parameters with more precise settings + GenExplosion.DoExplosion( + center: cell, + map: Map, + radius: 1.2f, // Slightly larger radius for better visual effect + damType: explosionDamageType, + instigator: caster, + damAmount: (int)damageAmount, + armorPenetration: armorPenetration, + explosionSound: null, + weapon: weaponDef, + projectile: null, + intendedTarget: null, + postExplosionSpawnThingDef: null, + postExplosionSpawnChance: 0f, + postExplosionSpawnThingCount: 1, + postExplosionGasType: null, + applyDamageToExplosionCellsNeighbors: true, // Apply damage to neighbor cells + preExplosionSpawnThingDef: null, + preExplosionSpawnChance: 0f, + preExplosionSpawnThingCount: 1, + chanceToStartFire: 0.1f, // Small chance to start fire + damageFalloff: true, // Add damage falloff + direction: null, + ignoredThings: ignoredThings, + affectedAngle: null, + doVisualEffects: true, + propagationSpeed: 0.5f, // Add some propagation speed for visual effect + screenShakeFactor: 0.3f, // Add screen shake + doSoundEffects: true, + postExplosionSpawnThingDefWater: null, + flammabilityChanceCurve: null, + overrideCells: null, + postExplosionSpawnSingleThingDef: null, + preExplosionSpawnSingleThingDef: null); } } - Destroy(); + + // Check if there are more bursts to come + if (currentBurstShot < burstShotsTotal - 1) + { + // Prepare for next burst + ticksToDetonate = 15; // Wait 15 ticks before next burst + currentBurstShot++; + } + else + { + // All bursts completed, destroy the mote + Destroy(); + } } } } \ No newline at end of file diff --git a/Source/WulaFallenEmpire/Verb/Verb_Excalibur.cs b/Source/WulaFallenEmpire/Verb/Verb_Excalibur.cs index e9ecb4f0..d1ee574c 100644 --- a/Source/WulaFallenEmpire/Verb/Verb_Excalibur.cs +++ b/Source/WulaFallenEmpire/Verb/Verb_Excalibur.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.CompilerServices; using RimWorld; using UnityEngine; using Verse; @@ -54,12 +53,10 @@ namespace WulaFallenEmpire { get { - // Use the damageAmount from VerbProperties if set, otherwise use the base damage if (this.ExcaliburProps.damageAmount > 0) { return this.ExcaliburProps.damageAmount; } - // Removed AncotUtility.QualityFactor, using a simple multiplier for now return 1.0f * this.damageAmountBase; } } @@ -68,27 +65,14 @@ namespace WulaFallenEmpire { get { - // Use the armorPenetration from VerbProperties if set, otherwise use the base value if (this.ExcaliburProps.armorPenetration >= 0) { return this.ExcaliburProps.armorPenetration; } - // Removed AncotUtility.QualityFactor, using a simple multiplier for now return 1.0f * this.armorPenetrationBase; } } - // Temporarily commented out CompWeaponCharge related code - /* - public CompWeaponCharge compCharge - { - get - { - return this.weapon.TryGetComp(); - } - } - */ - private VerbProperties_Excalibur ExcaliburProps { get @@ -97,6 +81,14 @@ namespace WulaFallenEmpire } } + protected override int ShotsPerBurst + { + get + { + return this.verbProps.burstShotCount; + } + } + protected override bool TryCastShot() { // Calculate all affected cells once @@ -111,14 +103,14 @@ namespace WulaFallenEmpire beam.pathWidth = this.ExcaliburProps.pathWidth; beam.weaponDef = this.CasterPawn.equipment.Primary.def; beam.damageDef = this.ExcaliburProps.damageDef; - beam.StartStrike(allAffectedCells, this.verbProps.burstShotCount, this.verbProps.burstShotCount); + beam.StartStrike(allAffectedCells, this.ShotsPerBurst, this.ShotsPerBurst); return true; } public override void DrawHighlight(LocalTargetInfo target) { - GenDraw.DrawFieldEdges(this.AffectedCells(target), SimpleColor.Red); + GenDraw.DrawFieldEdges(this.AffectedCells(target)); } private List AffectedCells(LocalTargetInfo target)