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))); }
public bool CanTransform(TraitContext context) { var carnivorous = context.TraitAction as CarnivorousAction; if (carnivorous != null) { return(!IsTapped && carnivorous.TargetAnimal == Animal && Animal.Count > 1); } return(false); }
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); }
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); }
public void Attach(TraitContext context) { context.TraitAction[typeof(Poisonous)] = new object(); Animal.Food.TakeFrom(context.Game.ExtraFood); }
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)); }