untaught Ai how to use prevent until someone with more knowledge then i can look at why the enum list wont allow for it to be listed. its commented out for now, and it works on PC just fine, not perfect but atleast Ai actually trys to keep all their creatures with atleast 1-3 prevent point on them during combat. the probelm it has is with compiling to PSPSDK, it doesnt like having STANDARD_PREVENT = 13, If someone could look into why it would dramatically help Ai using clerics.
This commit is contained in:
@@ -2784,7 +2784,7 @@ class AADamagePrevent:public ActivatedAbilityTP{
|
||||
public:
|
||||
int preventing;
|
||||
AADamagePrevent(int _id, MTGCardInstance * _source, Targetable * _target,int preventing, ManaCost * _cost=NULL, int doTap = 0, int who = TargetChooser::UNSET):ActivatedAbilityTP(_id,_source,_target,_cost,doTap,who),preventing(preventing){
|
||||
aType = MTGAbility::STANDARD_PREVENT;
|
||||
//aType = MTGAbility::STANDARD_PREVENT;
|
||||
}
|
||||
|
||||
int resolve(){
|
||||
|
||||
@@ -90,7 +90,7 @@ class MTGAbility: public ActionElement{
|
||||
FLASHBACK_COST = 10,
|
||||
RETRACE_COST = 11,
|
||||
MTG_COMBATTRIGGERS_RULE = 12,
|
||||
STANDARD_PREVENT = 13,
|
||||
//STANDARD_PREVENT = 13,
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -196,20 +196,20 @@ int AIAction::getEfficiency(){
|
||||
//TODO If the card is the target of a damage spell
|
||||
break;
|
||||
}
|
||||
case MTGAbility::STANDARD_PREVENT:
|
||||
{
|
||||
MTGCardInstance * _target = (MTGCardInstance *)(a->target);
|
||||
efficiency = 10;//starts out low to avoid spamming it when its not needed.
|
||||
if ((!_target->regenerateTokens && g->getCurrentGamePhase() == Constants::MTG_PHASE_COMBATBLOCKERS && (_target->defenser || _target->blockers.size())) || ((_target->canBlock()||_target->canAttack()) && _target->preventable < 2)){
|
||||
efficiency = 95;//increase this chance to be used in combat.
|
||||
}
|
||||
if (_target->preventable > 2){
|
||||
efficiency -= 10; //lower the chance to be used if the creature already has over 3 prevent points.
|
||||
}
|
||||
//basically a rip off of regen, if it is not regenerating, its combat blockers, it is being blocked or blocking, and has less then 3 prevents, the effeincy is increased.
|
||||
//TODO If the card is the target of a damage spell
|
||||
break;
|
||||
}
|
||||
//case MTGAbility::STANDARD_PREVENT:
|
||||
// {
|
||||
// MTGCardInstance * _target = (MTGCardInstance *)(a->target);
|
||||
// efficiency = 10;//starts out low to avoid spamming it when its not needed.
|
||||
// if ((!_target->regenerateTokens && g->getCurrentGamePhase() == Constants::MTG_PHASE_COMBATBLOCKERS && (_target->defenser || _target->blockers.size())) || ((_target->canBlock()||_target->canAttack()) && _target->preventable < 2)){
|
||||
// efficiency = 95;//increase this chance to be used in combat.
|
||||
// }
|
||||
// if (_target->preventable > 2){
|
||||
// efficiency -= 10; //lower the chance to be used if the creature already has over 3 prevent points.
|
||||
// }
|
||||
// //basically a rip off of regen, if it is not regenerating, its combat blockers, it is being blocked or blocking, and has less then 3 prevents, the effeincy is increased.
|
||||
// //TODO If the card is the target of a damage spell
|
||||
// break;
|
||||
// }
|
||||
case MTGAbility::MANA_PRODUCER: //can't use mana producers right now :/
|
||||
efficiency = 0;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user