static void Test1() { creature testCreature1 = new creature("Proteus"); testCreature1.PrintStats(); mastery tempM = new mastery(); tempM.SetClassMastery(bodypart.ClassTypes.ColdBlooded, 10, 10, 10, 10); tempM.SetClassMastery(bodypart.ClassTypes.Invertebrate, 10, 10, 10, 10); tempM.SetClassMastery(bodypart.ClassTypes.WarmBlooded, 10, 10, 10, 10); testCreature1.Mastery = tempM; bodypart head1 = new bodypart(bodypart.ClassTypes.Invertebrate, bodypart.PartTypes.Head, "test head1", 5, 3, 1, 2, 6); head1.AddAbility(new ability("bite!", new List<effect>() { new effect(Stats.statsType.CURRENT_HEALTH, -10, 1, true, false) }, false, false, new mastery(), new Stats(10, 10, 10, 10, 10))); bodypart Body1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Body, "Body 1", 2, 4, 5, 7, 8); bodypart Legs1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Legs, "Legs 1", 1, 3, 5, 3, 9); bodypart Accessory1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Accessory 1", 4, 1, 2, 1, 7); testCreature1.AddBodyPart(head1, creature.slots.Head); testCreature1.AddBodyPart(Body1, creature.slots.Body); testCreature1.AddBodyPart(Legs1, creature.slots.Legs); testCreature1.AddBodyPart(Accessory1, creature.slots.Accessory1); testCreature1.PrintBodyParts(); testCreature1.PrintStats(); testCreature1.PrintEffects(); bodypart Accessory2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Body 1", 4, 1, 2, 1, 0); testCreature1.AddBodyPart(Accessory2, creature.slots.Accessory1); testCreature1.PrintStats(); testCreature1.PrintAbilities(); }
static void BeginingCombatSim() { bodypart head1 = new bodypart(bodypart.ClassTypes.Invertebrate, bodypart.PartTypes.Head, "test head1", 400, 3, 100, 2, 6); head1.AddAbility(new ability("bite!", new List<effect>() { new effect(Stats.statsType.DAMAGE, 10, 2, true, false) }, false, false, new mastery(), new Stats(10, 10, 10, 10, 10))); bodypart Body1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Body, "Body 1", 2, 4, 5, 7, 8); bodypart Legs1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Legs, "Legs 1", 1, 3, 5, 3, 9); bodypart Accessory1 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Accessory 1", 4, 1, 2, 1, 7); bodypart head2 = new bodypart(bodypart.ClassTypes.Invertebrate, bodypart.PartTypes.Head, "test head1", 5, 3, 1, 2, 6); head2.AddAbility(new ability("bite!", new List<effect>() { new effect(Stats.statsType.DAMAGE, 10, 3, true, false) }, false, false, new mastery(), new Stats(10, 10, 10, 10, 10))); bodypart Body2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Body, "Body 1", 2, 4, 5, 7, 8); bodypart Legs2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Legs, "Legs 1", 1, 3, 5, 3, 9); bodypart Accessory2 = new bodypart(bodypart.ClassTypes.ColdBlooded, bodypart.PartTypes.Accessory, "Accessory 1", 4, 1, 2, 1, 7); creature Proteus = new creature(head1, Body1, Legs1, Accessory1, "Proteus"); creature Enemy1 = new creature(head2, Body2, Legs2, Accessory2, "Enemy"); Proteus.combatPrint(); Enemy1.combatPrint(); for (int i = 0; i < 10; i++) { Proteus.effectStep(); Enemy1.effectStep(); Proteus.useAbilityOn(Enemy1, "bite!"); Enemy1.combatPrint(); } }
/// <summary> /// Step the timeout, add per turn /// </summary> /// <param name="c">Creature to effect</param> /// <returns>False means timeout, time to remove</returns> public bool Step(creature c) { if (Timeout > 0) Timeout--; if (Timeout == 0) { this.Timeout = this.PerminentTimeout; return false; } if (Perturn) { c.addEffectMod(this); } return true; }
public void useAbilityOn(creature target, ability a) { foreach (effect e in a.Effects) { if (e.EffectedType == Stats.statsType.DAMAGE) this.GiveDamage(target, e); else target.AddEffect(e); } }
public void useAbilityOn(creature target, string abilityName) { useAbilityOn(target, this.Abilities.Find(x=>x.Name ==abilityName)); }
public void GiveDamage(creature Target, effect e) { /** TODO: Calculate Actual damage based on damaged based by effect **/ effect tempE = new effect(e); tempE.EffectMod = CalculateDamage2(myStats[Stats.statsType.STRENGTH], myStats[Stats.statsType.INTELLIGENCE], tempE.EffectMod); Target.TakeDamage(tempE); }