Effect boostEffect = new ConditionalContinousEffect(
new BoostSourceEffect(2, 0, Duration.WhileOnBattlefield),
new PermanentsOnTheBattlefieldCondition(filter),
"As long as you control an artifact, {this} gets +2/+0");
Effect gainAbilityEffect = new ConditionalContinousEffect(
new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield),
new PermanentsOnTheBattlefieldCondition(filter),
"and has trample");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, boostEffect);
ability.addEffect(gainAbilityEffect);
this.addAbility(ability);