public override IEnumerable <StatusEffect> GetGoodInterventions(Deity self, Level level, Agent agent) { if (Globals.Random.Next(100) < _chanceOfFire) { var fire = new StatusEffect { Name = $"{self.Name}'s fiery protection", TurnsRemaining = 10 }; fire.AddEffect(null, () => { _chanceOfFire /= 2; }, () => {}); fire.AddTurnEffect(null, () => { for (var ox = -2; ox < 3; ox++) { for (var oy = -2; oy < 3; oy++) { var other = level.GetAgent(agent.X + ox, agent.Y + oy); if (other != null && other != agent) { var onFire = GetFire(other); if (!other.StatusEffects.Any(e => e.Name == onFire.Name)) { onFire.Begin(level, other); agent.Messages.Add($"[color={Globals.TextColorGood}]{self.Name}[/color] sets {other.DisplayName} on fire"); } } } } }); yield return(fire); } }
public override IEnumerable <StatusEffect> GetGoodInterventions(Deity self, Level level, Agent agent) { if (Globals.Random.Next(100) < _chanceOfStun) { var protection = new StatusEffect { Name = $"[color={Globals.TextColorGood}]{self.Name}'s[/color] stunning protection", TurnsRemaining = 10 }; protection.AddEffect(null, () => { _chanceOfStun /= 2; }, () => {}); protection.AddTurnEffect(null, () => { for (var ox = -2; ox < 3; ox++) { for (var oy = -2; oy < 3; oy++) { var other = level.GetAgent(agent.X + ox, agent.Y + oy); if (other != null && other != agent && other.StatusEffects.Any(e => e.Name == "Stunned")) { var stun = new StatusEffect { Name = "Stunned", TurnsRemaining = 10 }; stun.AddTurnEffect("-AP", () => { other.AP -= 5; }); stun.Begin(level, other); agent.Messages.Add($"[color={Globals.TextColorGood}]{self.Name}[/color] stuns {other.DisplayName}"); } } } }); yield return(protection); } }
public override void AddToBlessing(Deity self, Level level, Agent agent, StatusEffect blessing) { if (totalGiven < 25) { blessing.AddTurnEffect("+money", () => { totalGiven++; agent.Money++; }); } }
public override void AddToCurse(Deity self, Level level, Agent agent, StatusEffect curse) { curse.AddTurnEffect("-money", () => { if (agent.Money > 0) { totalGiven--; agent.Money--; } }); }
public override void AddToBlessing(Deity self, Level level, Agent agent, StatusEffect blessing) { blessing.AddAttackEffect("stun attack", a => { var stun = new StatusEffect { Name = "Stunned", TurnsRemaining = 10 }; stun.AddTurnEffect("-2d4 AP each turn", () => { agent.AP -= 2 + Globals.Random.Next(4) + Globals.Random.Next(4); }); stun.Begin(level, a.Defender); }); }
private StatusEffect GetFire(Agent target) { var onFire = new StatusEffect { Name = "[color=#ff0000]On fire![/color]", TurnsRemaining = 3 }; onFire.AddEffect("-HP", () => target.BeginFire(), () => target.EndFire()); onFire.AddTurnEffect(null, () => target.TakeDamage(1)); return(onFire); }
public override IEnumerable <StatusEffect> GetGoodInterventions(Deity self, Level level, Agent agent) { if (_totalHealed < 10) { var healing = new StatusEffect { Name = $"the healing presence of [color={Globals.TextColorGood}]{self.Name}[/color]", TurnsRemaining = 5 }; healing.AddTurnEffect(null, () => { if (agent.HP < agent.HPMax) { _totalHealed++; } agent.TakeDamage(-1); }); yield return(healing); } }
public override void AddToCurse(Deity self, Level level, Agent agent, StatusEffect curse) { curse.AddTurnEffect("-2d4 AP each turn", () => { agent.AP -= 2 + Globals.Random.Next(4) + Globals.Random.Next(4); }); }