protected override void ProcessSingleInteraction(Interaction interaction) { switch (interaction.InteractionType) { case InteractionType.Infest: var targetUnit = this.GetUnit(interaction.TargetUnit); var targetUnitClassification = InfestationRequirements.RequiredClassificationToInfest(targetUnit.UnitClassification); if (interaction.SourceUnit.UnitClassification == UnitClassification.Biological && targetUnitClassification == UnitClassification.Biological) { targetUnit.AddSupplement(new InfestationSpores()); } else if (interaction.SourceUnit.UnitClassification == UnitClassification.Mechanical && targetUnitClassification == UnitClassification.Psionic) { targetUnit.AddSupplement(new InfestationSpores()); } else if (interaction.SourceUnit.UnitClassification == UnitClassification.Psionic && targetUnitClassification == UnitClassification.Psionic) { targetUnit.AddSupplement(new InfestationSpores()); } break; default: base.ProcessSingleInteraction(interaction); break; } }
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) { switch (interaction.InteractionType) { case InteractionType.Attack: Unit targetUnit1 = this.GetUnit(interaction.TargetUnit); Unit sourceUnit1 = this.GetUnit(interaction.SourceUnit); if (targetUnit1 is InfestorUnit) { var infestTarget1 = InfestationRequirements.RequiredClassificationToInfest(sourceUnit1.UnitClassification); if (targetUnit1.UnitClassification == infestTarget1) { sourceUnit1.AddSupplement(new InfestationSpores()); } } targetUnit1.DecreaseBaseHealth(interaction.SourceUnit.Power); break; //case InteractionType.Infest: // Unit targetUnit = this.GetUnit(interaction.TargetUnit); // Unit sourceUnit = this.GetUnit(interaction.SourceUnit); // var infestTarget = InfestationRequirements.RequiredClassificationToInfest(targetUnit.UnitClassification); // if (sourceUnit.UnitClassification == infestTarget) // { // targetUnit.AddSupplement(new InfestationSpores()); // } // break; default: base.ProcessSingleInteraction(interaction); break; } }
protected virtual void ProcessSingleInteraction(Interaction interaction) { switch (interaction.InteractionType) { case InteractionType.Attack: var targetUnit = this.GetUnit(interaction.TargetUnit); targetUnit.DecreaseBaseHealth(interaction.SourceUnit.Power); break; } }
protected override void ProcessSingleInteraction(Interaction interaction) { switch (interaction.InteractionType) { case InteractionType.Infest: var target = GetUnit(interaction.TargetUnit); target.AddSupplement(new InfestationSpores()); break; } base.ProcessSingleInteraction(interaction); }
protected override void ProcessSingleInteraction(Interaction interaction) { switch (interaction.InteractionType) { case InteractionType.Infest: Unit infestationUnit = this.GetUnit(interaction.TargetUnit); infestationUnit.AddSupplement(new InfestationSpores()); break; default: base.ProcessSingleInteraction(interaction); break; } }
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); }
protected override 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; } }
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; } }
protected override void ProcessSingleInteraction(Interaction interaction) { switch (interaction.InteractionType) { case InteractionType.Attack: Unit targetUnit = this.GetUnit(interaction.TargetUnit); var sourceUnit = this.GetUnit(interaction.SourceUnit); if (sourceUnit is Parasite || sourceUnit is Queen) { if (InfestationRequirements.RequiredClassificationToInfest(targetUnit.UnitClassification) == InfestationRequirements.RequiredClassificationToInfest(sourceUnit.UnitClassification)) { targetUnit.AddSupplement(new InfestationSpores()); return; } } targetUnit.DecreaseBaseHealth(interaction.SourceUnit.Power); break; default: break; } }