private void TryToActivateDemonicForm() { if (!IsEnabled) { return; } Active.CharacterOnMap.Deselect(); if (ParentCharacter.Name != "Demonic Rem") { ParentCharacter.Name = "Demonic Rem"; } if (ParentCharacter.Effects.All(e => e.Name != "Demonic Form Speed Boost")) { var speedBoost = new StatModifier(-1, AdditionalSpeed, ParentCharacter, StatType.Speed, "Demonic Form Speed Boost"); speedBoost.OnRemove += TryToActivateDemonicForm; ParentCharacter.Effects.Add(speedBoost); } if (ParentCharacter.Effects.All(e => e.Name != "Demonic Form Attack Boost")) { var attackBoost = new StatModifier(-1, AdditionalAttack, ParentCharacter, StatType.AttackPoints, "Demonic Form Attack Boost"); attackBoost.OnRemove += TryToActivateDemonicForm; ParentCharacter.Effects.Add(attackBoost); } ParentCharacter.Select(); }
HexMapDrawer.Instance.Cells.ForEach(c => c.Effects.FindAll(e => e.Name == Name).ForEach(e => e.Remove())); //TODO: create a list of effects to iterate on in case of 2 or more Yoshinos playing private void Disable() { RemoveHexEffects(); IsEnabled = false; ParentCharacter.Effects.RemoveAll(e => e.Name == Name); // Remove movement disability GetTargetsInRange().GetCharacters().ForEach(c => { var damage = new Damage(_currentDuration * DamagePerPhase, DamageType.Magical); ParentCharacter.Attack(this, c, damage); }); _currentDuration = 0; ParentCharacter.Select(); // Character can move immediately, and the ability button is not shown as clickable }
public void Click() { if (!IsEnabled) { Active.MakeAction(); IsEnabled = true; ParentCharacter.Effects.Add(new Flying(-1, ParentCharacter, Name)); ParentCharacter.Effects.Add(new StatModifier(-1, InitialADBonus, ParentCharacter, StatType.AttackPoints, Name)); ParentCharacter.HasFreeMoveUntilEndOfTheTurn = true; Finish(); } else { IsEnabled = false; ParentCharacter.Effects.RemoveAll(e => e.Name == Name); ParentCharacter.Select(); } }