Пример #1
0
 public override void OnEvent(Deity self, IEvent e)
 {
     switch (e)
     {
     case DidAttack attack when attack.Attacked.HP < 1:
         if (dislikesKillingTrees && attack.Attacked.Team == "plants")
         {
             self.Dislike(e.Level, attack.Attacker, "killing plants");
         }
         break;
     }
 }
Пример #2
0
 public override void OnEvent(Deity self, IEvent e)
 {
     switch (e)
     {
     case DidAttack attack:
         if (likesDefending && Globals.Random.NextDouble() < 0.2)
         {
             self.Like(e.Level, attack.Attacked, "defending");
         }
         if (dislikesAttacking && Globals.Random.NextDouble() < 0.2)
         {
             self.Dislike(e.Level, attack.Attacked, "attacking");
         }
         break;
     }
 }
Пример #3
0
 public override void OnEvent(Deity self, IEvent e)
 {
     switch (e)
     {
     case DidAttack attack when attack.Attacked.HP < 1:
         if (likesKillingEnemies && attack.Attacked.Team != attack.Attacker.Team)
         {
             self.Like(e.Level, attack.Attacker, "killing enemies");
         }
         if (dislikesKillingAllies && attack.Attacked.Team == attack.Attacker.Team)
         {
             self.Dislike(e.Level, attack.Attacker, "killing allies");
         }
         break;
     }
 }
Пример #4
0
    public override void OnEvent(Deity self, IEvent e)
    {
        switch (e)
        {
        case NextTurn next:
            var timedEffects = next.Player.StatusEffects.Where(ef => ef.TurnsRemaining != null).ToArray();
            if (timedEffects.Length > 0 &&
                Globals.Random.NextDouble() < 0.01)
            {
                var effect = timedEffects[Globals.Random.Next(timedEffects.Length)];
                next.Player.Messages.Add($"{self.Name} is bored of {effect.Name}");
                effect.End(null, next.Player);
            }

            switch (Globals.Random.Next(100))
            {
            case 0:
                self.Like(e.Level, next.Player, "you just because");
                break;

            case 1:
                self.Dislike(e.Level, next.Player, "you just because");
                break;
            }

            foreach (var key in self.FavorPerTeam.Keys.ToArray())
            {
                if (Globals.Random.NextDouble() < 0.9)
                {
                    continue;
                }

                if (self.FavorPerTeam[key] > 0)
                {
                    self.FavorPerTeam[key] += Globals.Random.Next(3) - Globals.Random.Next(4);
                }
                else
                {
                    self.FavorPerTeam[key] += Globals.Random.Next(4) - Globals.Random.Next(3);
                }
            }
            break;
        }
    }
Пример #5
0
 public override void OnEvent(Deity self, IEvent e)
 {
     switch (e)
     {
     case DidAttack attack when attack.Attacked.HP < 1:
         if (likesKillingLiving && attack.Attacked.Tags.Contains(AgentTag.Living))
         {
             self.Like(e.Level, attack.Attacker, "killing the living");
         }
         if (dislikesKillingUndead && attack.Attacked.Tags.Contains(AgentTag.Undead))
         {
             self.Dislike(e.Level, attack.Attacker, "killing the undead");
         }
         if (Globals.Random.NextDouble() < 0.5)
         {
             self.Like(e.Level, attack.Attacked, "how you died");
         }
         break;
     }
 }