void CalculateBuffScore(Combat testCombat, AIAction action) { int unitHits = 0; int score = 0; foreach (CombatNode node in testCombat.actorDamageMap) { if (node is BuffCombatNode) { BuffCombatNode n = node as BuffCombatNode; //lets figure out how to establish if the buff is positive or negative if ( (node.target.ActorsController().PlayerControlled() == true && n.buffToApply.IsBuff == false) || (node.target.ActorsController().PlayerControlled() == false && n.buffToApply.IsBuff == true) ) { //This means we're either buffing our allies or debuffing our enemies if (n.target.actorData.buffContainer.CanBuffBeApplied(n.buffToApply)) { action.SetScore(0.5f); } } } } }
public override void ActorEffect(Combat combat, Actor source, TileNode target) { if (target.HasActor()) { Buff casterBuff = Globals.campaign.contentLibrary.buffDatabase.GetCopy(buffForCaster); Buff targetBuff = Globals.campaign.contentLibrary.buffDatabase.GetCopy(buffForTarget); targetBuff.ID = Globals.GenerateRandomHex(); ActorData t = target.actorOnTile.actorData; TileNode casterNode = Globals.GetBoardManager().pathfinding.GetTileNode(source); casterBuff.effects.Add(new LinkedBuffBuffEffect(t, targetBuff)); targetBuff.effects.Add(new LinkedBuffBuffEffect(source.actorData, casterBuff)); //apply the actual buffs BuffCombatNode castNode = new BuffCombatNode(source, casterNode, casterBuff); BuffCombatNode targetNode = new BuffCombatNode(source, target, targetBuff); combat.actorDamageMap.Add(castNode); combat.actorDamageMap.Add(targetNode); } }
public override void ActorEffect(Combat combat, Actor source, TileNode target) { if (target.actorOnTile == null) { return; } Buff b = Globals.campaign.contentLibrary.buffDatabase.GetCopy(buffToApply); BuffCombatNode node = new BuffCombatNode(source, target, b); combat.actorDamageMap.Add(node); }
public override void ActorEffect(Combat combat, Actor source, TileNode target) { if (target.actorOnTile != null) { return; } ActorData ad = SpawnActorData(source, target); Buff b = Globals.campaign.contentLibrary.buffDatabase.GetCopy(buffKey); foreach (LinkBuffEffect linked in b.effects) { if (linked.linkedUnit == null) { linked.linkedUnit = ad; } } BuffCombatNode bnode = new BuffCombatNode(source, Globals.GetBoardManager().pathfinding.GetTileNode(source), b); SummonCombatNode snode = new SummonCombatNode(source, target, ad); combat.actorDamageMap.Add(bnode); combat.actorDamageMap.Add(snode); }