//defence blocks void BasicDefences(Being b) { Ability def1 = new Ability(b, "Block", 100, 1, true); def1.isDefence = true; def1.defenceSpeed = 50; ResourceAtValue_Condition reqStam = new ResourceAtValue_Condition(battleManager, b, "Stamina above 0", "STAMINA", ">", 0); ModulateResource_Effect costsStamina = new ModulateResource_Effect(battleManager, b, def1, "CostsStamina", "STAMINA", -10, true); Block_DefenceEffect block = new Block_DefenceEffect(battleManager, b, def1, "Block"); Self_TargetingCriteria self = new Self_TargetingCriteria(battleManager, b, def1); def1.effects.Add(block); def1.effects.Add(costsStamina); def1.conditions.Add(reqStam); def1.targetingCriteria.Add(self); b.defences.Add(def1); //Create a generic 'dodge' defence Ability def2 = new Ability(b, "Dodge", 100, 1, true); def2.isDefence = true; def2.defenceSpeed = 40; ResourceAtValue_Condition reqStam2 = new ResourceAtValue_Condition(battleManager, b, "Stamina above 0", "STAMINA", ">", 0); ModulateResource_Effect costsStamina2 = new ModulateResource_Effect(battleManager, b, def2, "CostsStamina", "STAMINA", -20, true); Dodge_DefenceEffect dodge = new Dodge_DefenceEffect(battleManager, b, def2, "Dodge"); Self_TargetingCriteria self2 = new Self_TargetingCriteria(battleManager, b, def2); def2.effects.Add(dodge); def2.effects.Add(costsStamina2); def2.conditions.Add(reqStam2); def2.targetingCriteria.Add(self2); b.defences.Add(def2); //Create a generic 'free action' defence Ability def3 = new Ability(b, "Any Action", 100, 1, true); def3.isDefence = true; def3.defenceSpeed = 5; NoCondition_Condition noCondition6 = new NoCondition_Condition(battleManager, b, "NoCondition"); Self_TargetingCriteria self3 = new Self_TargetingCriteria(battleManager, b, def3); AnyAction_DefenceEffect anyAction = new AnyAction_DefenceEffect(battleManager, b, def3, "AnyAction"); def3.effects.Add(anyAction); def3.conditions.Add(noCondition6); def3.targetingCriteria.Add(self3); b.defences.Add(def3); }
void BasicDefenceAbilities(Being b) { Ability dodge = new Ability(b, "Dodge", AbilityChassis.Dodge, AbilityType.PublicNormal, 100, 1, false); StatusIsNot_Condition notStaggered = new StatusIsNot_Condition(actionManager, b, "NoCondition", Being.Status.staggered); Dodge_DefenceEffect dodgeEffect = new Dodge_DefenceEffect(actionManager, b, dodge, "Dodge", CombatState.Hit, 0, 0); Others_TargetingCriteria others = new Others_TargetingCriteria(actionManager, b); dodge.conditions.Add(notStaggered); dodge.effects.Add(dodgeEffect); dodge.targetingCriteria.Add(others); b.abilities.Add(dodge); Ability block = new Ability(b, "Block", AbilityChassis.Block, AbilityType.PublicNormal, 100, 1, false); StatusIsNot_Condition notStaggered2 = new StatusIsNot_Condition(actionManager, b, "NoCondition", Being.Status.staggered); Block_DefenceEffect block2 = new Block_DefenceEffect(actionManager, b, block, "Block", CombatState.Hit, 0, 0); Others_TargetingCriteria others2 = new Others_TargetingCriteria(actionManager, b); block.conditions.Add(notStaggered2); block.effects.Add(block2); block.targetingCriteria.Add(others2); b.abilities.Add(block); }