public AProjectile(PrimaryObject source, PrimaryObject target, DamageType dmgType, int damage, int speed, int acceleration)
 {
     this.source       = source;
     this.target       = target;
     this.dmgType      = dmgType;
     this.damage       = damage;
     this.speed        = speed;
     this.acceleration = acceleration;
     position          = source.posCenter;
 }
 bool checkTargetConstraints(PrimaryObject target)
 {
     foreach (Constraint constraint in targetConstraints.Concat(source.targetConstraints))
     {
         if (!constraint.isAllowed(source, target))
         {
             return(false);
         }
     }
     return(true);
 }
Example #3
0
        // List

        public bool applyAndWatch(PrimaryObject holder)
        {
            switch (getBuffOverrideRule())
            {
            case BuffOverrideRule.NO_EFFECT:

                break;

            case BuffOverrideRule.STACK:

                break;

            case BuffOverrideRule.TIME_RESET:

                break;

            case BuffOverrideRule.STACK_TIME_RESET:

                break;
            }
        }
Example #4
0
 protected abstract void remove(PrimaryObject target);
Example #5
0
 protected abstract bool apply(PrimaryObject target);
Example #6
0
 abstract void removeEffects(PrimaryObject holder);
Example #7
0
 abstract void applyEffects(PrimaryObject holder);
Example #8
0
        public bool execute(PrimaryObject source, PrimaryObject target)
        {
            EffectWatcher watcher = createEffectWatcher();

            watcher.applyAndWatch(apply, remove, source, target);
        }
Example #9
0
 public ProjectileSplitGleive(PrimaryObject source, PrimaryObject target, DamageType dmgType, int damage, int speed, int acceleration) : base(source, target, dmgType, damage, speed, acceleration)
 {
 }
Example #10
0
        public void applyAndWatch(Action <PrimaryObject, PrimaryObject> applyEffectAction, Action <PrimaryObject, PrimaryObject> removeEffectAction, Effect effect, PrimaryObject source, PrimaryObject target)
        {
            this.applyEffectAction  = applyEffectAction;
            this.removeEffectAction = removeEffectAction;


            bool wasApplied = applyEffectAction(source, target);


            Task.Factory.StartNew(() => startWatchingAsync());
        }
Example #11
0
 public ProjectileGleive(PrimaryObject source, PrimaryObject target, DamageType dmgType, int damage, int speed, int acceleration, int remainingNumberOfTargets) : base(source, target, dmgType, damage, speed, acceleration)
 {
 }