protected override void CreateSummons(int triggerIndex) { BuffData.Summon[][] summonss = this._buff.trigger.summons; int index = summonss.Length - 1; index = triggerIndex <= index ? triggerIndex : index; BuffData.Summon[] summons = summonss[index]; Battle battle = this._buff.battle; int count = summons.Length; for (int i = 0; i < count; i++) { BuffData.Summon summon = summons[i]; Vec3 buffPos = this._buff.property.position; float distance = battle.random.NextFloat(this._buff.radius - 0.5f, this._buff.radius + 0.5f); Quat q = Quat.Euler(0f, battle.random.NextFloat(0f, 360f), 0f); Vec3 offset = q * Vec3.right * distance; offset.y = this._buff.caster.size.y * 0.5f; FoxFire foxFire = battle.CreateBio <FoxFire>(summon.id, buffPos + offset, this._buff.property.direction, this._buff.caster.property.team); foxFire.Setup(this._buff.property.lvl, this._buff.caster, distance); } }
protected virtual void CreateSummons(int triggerIndex) { BuffData.Summon[][] summonss = this._buff.trigger.summons; if (summonss == null) { return; } int index = summonss.Length - 1; index = triggerIndex <= index ? triggerIndex : index; BuffData.Summon[] summons = summonss[index]; Battle battle = this._buff.battle; int count = summons.Length; for (int i = 0; i < count; i++) { BuffData.Summon summon = summons[i]; if (string.IsNullOrEmpty(summon.id)) { continue; } for (int j = 0; j < summon.count; j++) { Vec3 position; Vec3 direction; Vec3 buffPos = this._buff.property.position; switch (summon.fill) { default: Vec2 insideUnitCircle = battle.random.insideUnitCircle * this._buff.radius; position = new Vec3(buffPos.x + insideUnitCircle.x, buffPos.y, buffPos.z + insideUnitCircle.y); break; case BuffData.Summon.Fill.BaseShell: Vec3 onUnitSphere = battle.random.onUnitSphere * this._buff.radius; position = new Vec3(buffPos.x + onUnitSphere.x, buffPos.y, buffPos.z + onUnitSphere.z); break; } switch (summon.direction) { default: Vec2 insideUnitCircle = battle.random.insideUnitCircle; direction = Vec3.Normalize(new Vec3(insideUnitCircle.x, 0, insideUnitCircle.y)); break; case BuffData.Summon.Direction.FollowCaster: direction = this._buff.caster.property.direction; break; } battle.CreateBio(summon.id, position, direction, this._buff.caster.property.team); } } }