private void SourceView() { if (HeadersSource == null) { HeadersSource = new List <EffectActor>(); SelectedSource = null; } EffectActor dis = null; foreach (var s in HeadersSource) { GUILayout.BeginHorizontal(); EditorGUILayout.ObjectField(s, s.GetType(), true); if (GUILayout.Button("删除")) { dis = s; } if (GUILayout.Button("选中")) { SelectedSource = s; } GUILayout.EndHorizontal(); } if (dis != null) { GameObject.DestroyImmediate(dis.gameObject); } GUILayout.Label("当前选中:"); GUILayout.Label(SelectedSource == null ? "空" : SelectedSource.Name); }
private static void raiseNewEffect(Effect.EffectType effectType) { if (Effect.arrayOfViewableEffects.Contains(effectType)) { Effect effect = new Effect(effectType); EffectActor actor = EffectActor.CreateNewEffectActor(effect).GetComponent <EffectActor>(); actor.ShowHalo(); } EffectEvents.DoEffect(effectType); }
private static IEnumerator RemoveSingleEffectCoroutine(EffectActor effectActor) { float duration = 1.5f; yield return(new WaitForSeconds(.01f)); Sequence sequence = DOTween.Sequence(); effectActor.transform.parent = null; sequence.Append(effectActor.transform.DOScale(.1f, duration)); sequence.Insert(0, effectActor.transform.DORotate(new Vector3(0, 0, 355), duration)); sequence.Append(effectActor.transform.DOMove(Visual.instance.CardPointDiscard.transform.position, .01f)); sequence.AppendCallback(() => { effectActor.transform.SetParent(Visual.instance.CardPointDiscard.transform); }); }
private void SequenceUpdate(EffectActor actor) { for (int i = 0; i < probes.Length; i++) { if (!matrix[i].IsRun) { continue; } if (probes[i] < matrix[i].Length) { if (matrix[i][probes[i]] == actor) { probes[i] = probes[i] + 1; } } } ActorsResponse(); }
private IEnumerator PrepareCardForNewGameCoroutine() { foreach (CardManager.Card card in Game.instance.currentDeck) { GameObject cardObject = OneCardManager.CreateOneCardManager(card, Visual.instance.CardDeckFrame); cardObject.transform.DORotate(new Vector3(0f, 179f, 0f), 0); } SameDistanceChildren distance = Visual.instance.CurrentEncounter.GetComponent <SameDistanceChildren>(); foreach (CardManager.Card card in Game.instance.currentEncounter) { int index = Game.instance.currentEncounter.IndexOf(card); GameObject slot = distance.slots[index]; GameObject cardObject = OneCardManager.CreateOneCardManager(card, slot); } SameDistanceChildren treasureHand = Visual.instance.TreasureHand.GetComponent <SameDistanceChildren>(); foreach (CardManager.Card card in Game.instance.TreasureHand) { int index = Game.instance.TreasureHand.IndexOf(card); GameObject slot = treasureHand.slots[index]; GameObject cardObject = OneCardManager.CreateOneCardManager(card, slot); } foreach (Effect effect in Game.instance.CardEffects) { GameObject effectActorObject = EffectActor.CreateNewEffectActor(effect); } yield return(new WaitForSeconds(.01f)); GameLogicEvents.eventUpdateCurrentEncounter.Invoke(); Command.CommandExecutionComplete(); }
//NoRune:blank, A: radius, B: Bounce, C: Pool, D: Turret, E: chainLightning //TODO:Rune_B,D,E //Rune_B -> Allows skull to bounce up to two times, reduce damage by 15% //Rune_E -> Instead of firebomb doing AoE, each does direct damage to enemy then bounces to up to nearby enemies, reduce damage by 20% public override IEnumerable<TickTimer> Main() { UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); Projectile[] grenades = new Projectile[1]; for (int i = 0; i < grenades.Length; ++i) { var projectile = new Projectile(this, 6453, User.Position); grenades[i] = projectile; } float height = ScriptFormula(3); for (int i = 0; i < grenades.Length; ++i) { grenades[i].LaunchArc(PowerMath.TranslateDirection2D(TargetPosition, User.Position, TargetPosition, 0f), height, ScriptFormula(2)); } yield return grenades[0].ArrivalTime; if (Rune_D > 0) { //TODO:figure out the column animation. var FireColumn = new EffectActor(this, -1, TargetPosition); FireColumn.Timeout = WaitSeconds(ScriptFormula(14)); FireColumn.Scale = 2f; FireColumn.Spawn(); FireColumn.UpdateDelay = 0.33f; // attack every half-second FireColumn.OnUpdate = () => { var targets = GetEnemiesInRadius(FireColumn.Position, ScriptFormula(26)); if (targets.Actors.Count > 0 && targets != null) { targets.SortByDistanceFrom(FireColumn.Position); var proj = new Projectile(this, 193969, FireColumn.Position); proj.Position.Z += 5f; // unknown if this is needed proj.OnCollision = (hit) => { WeaponDamage(hit, ScriptFormula(13), DamageType.Fire); proj.Destroy(); }; FireColumn.TranslateFacing(targets.Actors[0].Position, true); proj.LaunchArc(targets.Actors[0].Position, ScriptFormula(29), ScriptFormula(28)); } }; } else { foreach (var grenade in grenades) { var grenadeN = grenade; SpawnEffect(6451, TargetPosition); if (Rune_C > 0) { var pool = SpawnEffect(6483, grenade.Position, 0, WaitSeconds(ScriptFormula(12))); pool.UpdateDelay = 1f; pool.OnUpdate = () => { WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(11)), ScriptFormula(10), DamageType.Fire); }; } AttackPayload attack = new AttackPayload(this); attack.Targets = GetEnemiesInRadius(grenade.Position, ScriptFormula(4)); attack.AddWeaponDamage(ScriptFormula(0), DamageType.Fire); attack.OnHit = (hitPayload) => { if (Rune_A > 0) { SpawnEffect(193964, grenade.Position); WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(5)), ScriptFormula(6), DamageType.Fire); } }; attack.Apply(); } } }
public override IEnumerable<TickTimer> Main() { UsePrimaryResource(EvalTag(PowerKeys.ResourceCost)); //ScriptFormula(6) = Max Hydra Clusters Vector3D userCastPosition = new Vector3D(User.Position); Vector3D[] spawnPoints = PowerMath.GenerateSpreadPositions(TargetPosition, new Vector3D(TargetPosition.X, TargetPosition.Y + 0.7f, TargetPosition.Z), 120, 3); var timeout = WaitSeconds(ScriptFormula(0)); var lavapool = SpawnEffect(RuneSelect(81103, 83028, 81238, 77112, 83964, 81239), TargetPosition, 0, timeout); //Lava Pool Spawn lavapool.PlayEffectGroup(RuneSelect(81102, 82995, 82116, -1, 86328, 81301)); int[] actorSNOs = new int[] { RuneSelect(80745, 82972, 82109, 82111, -1, 81515), RuneSelect(80757, 83024, 81229, 81226, -1, 81231), RuneSelect(80758, 83025, 81230, 81227, -1, 81232) }; if (Rune_D > 0) { //big hydra -> this throws an exception once spawned. var hydra1 = new EffectActor(this, 83959, spawnPoints[0]); hydra1.Scale = 2f; hydra1.Spawn(); hydra1.UpdateDelay = 3f; hydra1.OnUpdate = () => { var target = GetEnemiesInRadius(hydra1.Position, 50f).GetClosestTo(hydra1.Position); float castAngle = MovementHelpers.GetFacingAngle(hydra1.Position, target.Position); hydra1.TranslateFacing(target.Position, true); //timeout is set to 3, but starts while casting firewall, when it should start after firewall has spawned (1.8seconds) var firewall = SpawnEffect(86082, hydra1.Position, castAngle, WaitSeconds(3f)); firewall.UpdateDelay = 1f; firewall.OnUpdate = () => { WeaponDamage(GetEnemiesInBeamDirection(hydra1.Position, target.Position, 50f, 5f), 1.00f, DamageType.Fire); }; }; } else if (Rune_A > 0) { var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout); hydra1.UpdateDelay = 1.5f; // attack every half-second hydra1.OnUpdate = () => { var target = GetEnemiesInRadius(hydra1.Position, 15f).GetClosestTo(hydra1.Position); float castAngle = MovementHelpers.GetFacingAngle(hydra1.Position, target.Position); hydra1.TranslateFacing(target.Position, true); var ConeOfCold = SpawnEffect(83043, hydra1.Position, castAngle, WaitSeconds(ScriptFormula(7))); ConeOfCold.UpdateDelay = ScriptFormula(6); ConeOfCold.OnUpdate = () => { WeaponDamage(GetEnemiesInArcDirection(hydra1.Position, Target.Position, ScriptFormula(3), ScriptFormula(2)), 1.00f, DamageType.Cold); }; }; } else if (Rune_B > 0) { var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout); hydra1.UpdateDelay = 1.5f; // attack every half-second hydra1.OnUpdate = () => { var targets = GetEnemiesInRadius(hydra1.Position, 50f); if (targets.Actors.Count > 0 && targets != null) { //capsule width TODO targets.SortByDistanceFrom(hydra1.Position); hydra1.TranslateFacing(targets.Actors[0].Position, true); hydra1.AddRopeEffect(83875, targets.Actors[0]); WeaponDamage(targets.Actors[0], 1.00f, DamageType.Lightning); } }; } else { var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout); hydra1.UpdateDelay = 1.5f; // attack every half-second hydra1.OnUpdate = () => { var targets = GetEnemiesInRadius(hydra1.Position, 60f); if (targets.Actors.Count > 0 && targets != null) { targets.SortByDistanceFrom(hydra1.Position); var proj = new Projectile(this, RuneSelect(77116, 83043, -1, 77109, 86082, 77097), hydra1.Position); proj.Position.Z += 5f; // fix height proj.OnCollision = (hit) => { if (Rune_C > 0) { hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739)); hit.PlayEffectGroup(215394); var PoisonCloud = SpawnProxy(hit.Position, WaitSeconds(ScriptFormula(5))); PoisonCloud.UpdateDelay = ScriptFormula(4); // attack every half-second PoisonCloud.OnUpdate = () => { WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(6)), 1.00f, DamageType.Poison); }; } else if (Rune_E > 0) { hit.PlayEffectGroup(81874); WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(0)), 1.00f, DamageType.Arcane); } else { hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739)); WeaponDamage(hit, 1.00f, DamageType.Fire); } proj.Destroy(); }; hydra1.TranslateFacing(targets.Actors[0].Position, true); //need to fix how fast it fires -> its firing before head turns. proj.Launch(targets.Actors[0].Position, ScriptFormula(2)); } }; } // wait for duration of skill yield return timeout; }
public override IEnumerable<TickTimer> Main() { UsePrimaryResource(60f); //This works much better, but all three heads fire at the same target, //then need to be firing off less than a second a part, like .5s. Vector3D userCastPosition = new Vector3D(User.Position); Vector3D[] spawnPoints = PowerMath.GenerateSpreadPositions(TargetPosition, new Vector3D(TargetPosition.X, TargetPosition.Y + 0.7f, TargetPosition.Z), 120, 3); var timeout = WaitSeconds(ScriptFormula(0)); var lavapool = SpawnEffect(RuneSelect(81103, 83028, 81238, 77112, 83964, 81239), TargetPosition, 0, timeout); //Lava Pool Spawn lavapool.PlayEffectGroup(RuneSelect(81102, 82995, 82116, -1, 86328, 81301)); int[] actorSNOs = new int[] { RuneSelect(80745, 82972, 82109, 82111, -1, 81515), RuneSelect(80757, 83024, 81229, 81226, -1, 81231), RuneSelect(80758, 83025, 81230, 81227, -1, 81232) }; if (Rune_D > 0) { //big hydra -> this throws an exception once spawned. var hydra1 = new EffectActor(this, 83959, spawnPoints[0]); hydra1.Scale = 2f; hydra1.Spawn(); hydra1.UpdateDelay = 3f; hydra1.OnUpdate = () => { var target = GetEnemiesInRadius(hydra1.Position, 50f).GetClosestTo(hydra1.Position); float castAngle = MovementHelpers.GetFacingAngle(hydra1.Position, target.Position); hydra1.TranslateFacing(target.Position, true); //timeout is set to 3, but starts while casting firewall, when it should start after firewall has spawned (1.8seconds) var firewall = SpawnEffect(86082, hydra1.Position, castAngle, WaitSeconds(3f)); firewall.UpdateDelay = 1f; firewall.OnUpdate = () => { WeaponDamage(GetEnemiesInBeamDirection(hydra1.Position, target.Position, 50f, 5f), 1.00f, DamageType.Fire); }; }; } else { var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout); hydra1.UpdateDelay = 1f; // attack every half-second hydra1.OnUpdate = () => { var targets = GetEnemiesInRadius(hydra1.Position, 60f); if (targets.Actors.Count > 0 && targets != null) { targets.SortByDistanceFrom(hydra1.Position); var proj = new Projectile(this, RuneSelect(77116, 83043, -1, 77109, 86082, 77097), hydra1.Position); proj.Position.Z += 5f; // fix height proj.OnCollision = (hit) => { hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739)); WeaponDamage(hit, 1.00f, DamageType.Fire); proj.Destroy(); }; hydra1.TranslateFacing(targets.Actors[0].Position, true); //need to fix how fast it fires -> its firing before head turns. proj.Launch(targets.Actors[0].Position, ScriptFormula(2)); } }; var hydra2 = SpawnEffect(actorSNOs[1], spawnPoints[1], 0, timeout); hydra2.UpdateDelay = 1f; // attack every half-second hydra2.OnUpdate = () => { var targets = GetEnemiesInRadius(hydra2.Position, 60f); if (targets.Actors.Count > 0 && targets != null) { targets.SortByDistanceFrom(hydra2.Position); var proj = new Projectile(this, RuneSelect(77116, 83043, -1, 77109, 86082, 77097), hydra2.Position); proj.Position.Z += 5f; // fix height proj.OnCollision = (hit) => { hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739)); WeaponDamage(hit, 1.00f, DamageType.Fire); proj.Destroy(); }; //need to fix how fast it fires -> its firing before head turns. hydra2.TranslateFacing(targets.Actors[0].Position, true); proj.Launch(targets.Actors[0].Position, ScriptFormula(2)); } }; var hydra3 = SpawnEffect(actorSNOs[2], spawnPoints[2], 0, timeout); hydra3.UpdateDelay = 1f; // attack every half-second hydra3.OnUpdate = () => { var targets = GetEnemiesInRadius(hydra3.Position, 60f); if (targets.Actors.Count > 0 && targets != null) { targets.SortByDistanceFrom(hydra3.Position); var proj = new Projectile(this, RuneSelect(77116, 83043, -1, 77109, 86082, 77097), hydra3.Position); proj.Position.Z += 5f; // fix height proj.OnCollision = (hit) => { hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739)); WeaponDamage(hit, 1.00f, DamageType.Fire); proj.Destroy(); }; hydra3.TranslateFacing(targets.Actors[0].Position, true); //need to fix how fast it fires -> its firing before head turns. proj.Launch(targets.Actors[0].Position, ScriptFormula(2)); } }; } // wait for duration of skill yield return timeout; }
private void Awake() { instance = this; effectActor = this.EffectActorObject.GetComponent <EffectActor>(); Hide(); }