protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            string supplementTargetID = commandWords[2];
            string supplementType     = commandWords[1];
            Unit   targetUnit         = this.GetUnit(supplementTargetID);

            switch (supplementType)
            {
            case "AggressionCatalyst":
                targetUnit.AddSupplement(new AggressionCatalyst());
                break;

            case "HealthCatalyst":
                targetUnit.AddSupplement(new HealthCatalyst());
                break;

            case "PowerCatalyst":
                targetUnit.AddSupplement(new PowerCatalyst());
                break;

            case "Weapon":
                targetUnit.AddSupplement(new Weapon());
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            switch (commandWords[1])
            {
            case "PowerCatalyst":
                var  powerCatalyst = new PowerCatalyst();
                Unit targetUnit    = this.GetUnit(commandWords[2]);
                targetUnit.AddSupplement(powerCatalyst);
                break;

            case "HealthCatalyst":
                var healthCatalyst = new HealthCatalyst();
                targetUnit = this.GetUnit(commandWords[2]);
                targetUnit.AddSupplement(healthCatalyst);
                break;

            case "AggressionInhibitor":
                var aggressionCatalyst = new AggressionCatalyst();
                targetUnit = this.GetUnit(commandWords[2]);
                targetUnit.AddSupplement(aggressionCatalyst);
                break;

            case "Weapon":
                var weapon = new Weapon();
                targetUnit = this.GetUnit(commandWords[2]);
                targetUnit.AddSupplement(weapon);
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        protected virtual void ExecuteAddSupplementCommand(string[] commandWords)
        {
            Unit dUnit = GetUnit(commandWords[2]);

            switch (commandWords[1])
            {
            case "AggressionCatalyst":
                var aggressionSupplement = new AggressionCatalyst();
                dUnit.AddSupplement(aggressionSupplement);
                break;

            case "HealthCatalyst":
                var healthSupplement = new HealthCatalyst();
                dUnit.AddSupplement(healthSupplement);
                break;

            case "PowerCatalyst":
                var powerSupplement = new PowerCatalyst();
                dUnit.AddSupplement(powerSupplement);
                break;

            case "Weapon":
                var weaponSupplement = new Weapon();
                dUnit.AddSupplement(weaponSupplement);
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 4
0
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            ISupplement supplement;
            Unit        unit = GetUnit(commandWords[2]);

            switch (commandWords[1])
            {
            case "PowerCatalyst":
                supplement = new PowerCatalyst();
                break;

            case "AggressionCatalyst":
                supplement = new AggressionCatalyst();
                break;

            case "HealthCatalyst":
                supplement = new HealthCatalyst();
                break;

            case "Weapon":
                supplement = new Weapon();
                break;

            default:
                throw new ArgumentException("No such supplement");
            }

            unit.AddSupplement(supplement);
        }
Exemplo n.º 5
0
        protected override void ProcessSingleInteraction(Interaction interaction)
        {
            switch (interaction.InteractionType)
            {
            case InteractionType.Infest:
            {
                Unit targetUnit = this.GetUnit(interaction.TargetUnit);
                Unit unit       = this.GetUnit(interaction.SourceUnit);

                var infestor = unit as Parasite;

                if (infestor != null)
                {
                    var infestationSpores = new InfestationSpores();
                    targetUnit.AddSupplement(infestationSpores);
                }

                //targetUnit.DecreaseBaseHealth(interaction.SourceUnit.Power);
                break;
            }

            default:
                base.ProcessSingleInteraction(interaction);
                break;
            }
        }
        protected override void ProcessSingleInteraction(Interaction interaction)
        {
            try
            {
                switch (interaction.InteractionType)
                {
                case InteractionType.Attack:
                    Unit targetUnit = this.GetUnit(interaction.TargetUnit);
                    targetUnit.DecreaseBaseHealth(interaction.SourceUnit.Power);
                    break;

                case InteractionType.Infest:
                    Unit targetUnit1 = this.GetUnit(interaction.TargetUnit);
                    if (InfestationRequirements.RequiredClassificationToInfest(targetUnit1.UnitClassification) == interaction.SourceUnit.UnitClassification)
                    {
                        targetUnit1.AddSupplement(new InfestationSpores());
                    }
                    break;

                default:
                    break;
                }
            }
            catch
            {
            }
        }
Exemplo n.º 7
0
 private void GetInfest(Unit targetUnit)
 {
     if (true)
     {
         var infestationSpores = new InfestationSpores();
         targetUnit.AddSupplement(infestationSpores);
     }
 }
 private void AddWeaponSupplement(Unit unit)
 {
     Weapon weapon = null;
     if (unit is Marine)
     {
         weapon = new Weapon(Weapon.WeaponHealth, Weapon.WeaponPower, Weapon.WeaponAggression);
     }
     else
     {
         weapon = new Weapon();
     }
     unit.AddSupplement(weapon);
 }
Exemplo n.º 9
0
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            string targetUnitId = commandWords[2];
            Unit   targetUnit   = this.GetUnit(commandWords[2]);

            var supplementType = Type.GetType("Infestation." + commandWords[1]);

            if (supplementType != typeof(InfestationSpores) || supplementType != typeof(WeaponrySkill))
            {
                var supplement = (ISupplement)Activator.CreateInstance(supplementType);
                targetUnit.AddSupplement(supplement);
            }
        }
Exemplo n.º 10
0
        protected override void ProcessSingleInteraction(Interaction interaction)
        {
            switch (interaction.InteractionType)
            {
            case InteractionType.Infest:
                Unit targetUnit = this.GetUnit(interaction.TargetUnit);
                targetUnit.AddSupplement(new InfestationSpores());
                break;

            default:
                base.ProcessSingleInteraction(interaction);
                break;
            }
        }
Exemplo n.º 11
0
        protected override void ExecuteAddSupplementCommand(string[] commandWords)
        {
            Unit unit = this.GetUnit(commandWords[2]);

            switch (commandWords[1])
            {
            case "PowerCatalyst":
            {
                unit.AddSupplement(new PowerCatalyst());
                break;
            }

            case "AggressionCatalyst":
            {
                unit.AddSupplement(new AggressionCatalyst());
                break;
            }

            case "HealthCatalyst":
            {
                unit.AddSupplement(new HealthCatalyst());
                break;
            }

            case "Weapon":
            {
                unit.AddSupplement(new Weapon());
                break;
            }

            default:
            {
                base.ExecuteAddSupplementCommand(commandWords);
                break;
            }
            }
        }
Exemplo n.º 12
0
        protected override void ProcessSingleInteraction(Interaction interaction)
        {
            //	Infesting is equivalent to adding an InfestationSpores Supplement to the target
            switch (interaction.InteractionType)
            {
            case InteractionType.Infest:
                Unit targetUnit = this.GetUnit(interaction.TargetUnit);
                targetUnit.AddSupplement(new InfestationSpores());
                break;

            default:
                break;
            }
            base.ProcessSingleInteraction(interaction);
        }
Exemplo n.º 13
0
 protected virtual void ProcessSingleInteraction(Interaction interaction)
 {
     Unit targetUnit = this.GetUnit(interaction.TargetUnit);
     switch (interaction.InteractionType)
     {
         case InteractionType.Attack:
             targetUnit.DecreaseBaseHealth(interaction.SourceUnit.Power);
             break;
         case InteractionType.Infest:
                 targetUnit.AddSupplement(new InfestationSpores());
             break;
         default:
             break;
     }
 }
Exemplo n.º 14
0
        protected override void ProcessSingleInteraction(Interaction interaction)
        {
            switch (interaction.InteractionType)
            {
            case InteractionType.Infest:
                Unit targetUnit = this.GetUnit(interaction.TargetUnit);
                Unit sourceUnit = this.GetUnit(interaction.SourceUnit);
                if (CheckForInfesting(sourceUnit, targetUnit))
                {
                    targetUnit.AddSupplement(new InfestationSpores());
                }
                break;

            default:
                base.ProcessSingleInteraction(interaction);
                break;
            }
        }
Exemplo n.º 15
0
        protected override void ProcessSingleInteraction(Interaction interaction)
        {
            switch (interaction.InteractionType)
            {
            case InteractionType.Infest:
                Unit targetUnit = this.GetUnit(interaction.TargetUnit);
                Unit sourceUnit = this.GetUnit(interaction.SourceUnit);
                if (sourceUnit.UnitClassification == InfestationRequirements.RequiredClassificationToInfest(targetUnit.UnitClassification))
                {
                    var infestationSpore = new InfestationSpores();
                    targetUnit.AddSupplement(infestationSpore);
                }

                break;

            default:
                base.ProcessSingleInteraction(interaction);
                break;
            }
        }
Exemplo n.º 16
0
        protected override void ProcessSingleInteraction(Interaction interaction)
        {
            switch (interaction.InteractionType)
            {
            case InteractionType.Infest:
                Unit targetUnit = this.GetUnit(interaction.TargetUnit);


                if ((targetUnit.UnitClassification == UnitClassification.Biological && this.GetUnit(interaction.SourceUnit).UnitClassification == UnitClassification.Biological) ||
                    (targetUnit.UnitClassification == UnitClassification.Mechanical && this.GetUnit(interaction.SourceUnit).UnitClassification == UnitClassification.Psionic) ||
                    (targetUnit.UnitClassification == UnitClassification.Mechanical && this.GetUnit(interaction.SourceUnit).UnitClassification == UnitClassification.Psionic)
                    )
                {
                    targetUnit.AddSupplement(new InfestationSpores());
                }

                break;

            default:
                base.ProcessSingleInteraction(interaction);
                break;
            }
        }