Ejemplo n.º 1
0
        public TraitAction Transform(TraitContext context)
        {
            this.Tap(context);

            var carnivorous = (CarnivorousAction)context.TraitAction;

            return(new CarnivorousAction(carnivorous.Trait, Animal.Player.Brain.SelectAnimal(this.GetTargetAnimals(carnivorous), false)));
        }
Ejemplo n.º 2
0
        public bool CanTransform(TraitContext context)
        {
            var carnivorous = context.TraitAction as CarnivorousAction;

            if (carnivorous != null)
            {
                return(!IsTapped && carnivorous.TargetAnimal == Animal && Animal.Count > 1);
            }

            return(false);
        }
Ejemplo n.º 3
0
        public TraitAction Transform(TraitContext context)
        {
            this.Tap(context);

            if (context.Game.Random.Next(1, 7) > 3)
            {
                return(new RunningAction(this, ((CarnivorousAction)context.TraitAction).Trait));
            }

            return(context.TraitAction);
        }
Ejemplo n.º 4
0
        public bool CanAttach(TraitContext context)
        {
            var carnivorous = context.TraitAction as CarnivorousAction;

            if (carnivorous != null)
            {
                return(carnivorous.TargetAnimal.Player == Animal.Player &&
                       Animal.Food.HasRoomForMore &&
                       context.TraitAction[typeof(Poisonous)] == null);
            }

            return(false);
        }
Ejemplo n.º 5
0
 public void Attach(TraitContext context)
 {
     context.TraitAction[typeof(Poisonous)] = new object();
     Animal.Food.TakeFrom(context.Game.ExtraFood);
 }
Ejemplo n.º 6
0
        public TraitAction Transform(TraitContext context)
        {
            var tailTrait = Animal.Player.Brain.SelectTrait(Animal.Traits.Skip(1), false);

            return(new TailLossAction(this, tailTrait, (Carnivorous)context.TraitAction.Trait));
        }