mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added stack descriptions for DealDamage and Pump
- Cleanup for Propaganda stuff. - AI now actually pays for Genesis ability
This commit is contained in:
@@ -38,6 +38,11 @@ public class AbilityFactory_DealDamage {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStackDescription(){
|
||||||
|
return damageStackDescription(AF, this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
doResolve(this);
|
doResolve(this);
|
||||||
@@ -73,6 +78,11 @@ public class AbilityFactory_DealDamage {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStackDescription(){
|
||||||
|
return damageStackDescription(AF, this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
doResolve(this);
|
doResolve(this);
|
||||||
@@ -221,6 +231,38 @@ public class AbilityFactory_DealDamage {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String damageStackDescription(AbilityFactory af, SpellAbility sa){
|
||||||
|
// when damageStackDescription is called, just build exactly what is happening
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String name = af.getHostCard().getName();
|
||||||
|
int damage = getNumDamage(sa);
|
||||||
|
|
||||||
|
ArrayList<Object> tgts;
|
||||||
|
Target tgt = AF.getAbTgt();
|
||||||
|
if (tgt != null)
|
||||||
|
tgts = tgt.getTargets();
|
||||||
|
else{
|
||||||
|
tgts = new ArrayList<Object>();
|
||||||
|
if (TgtOpp)
|
||||||
|
tgts.add(AF.getHostCard().getController().getOpponent());
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append(name).append(" - ");
|
||||||
|
sb.append("Deals").append(damage).append(" damage to ");
|
||||||
|
for(int i = 0; i < tgts.size(); i++){
|
||||||
|
Object o = tgts.get(0);
|
||||||
|
if (o instanceof Player){
|
||||||
|
sb.append(((Player)o).getName());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
sb.append(((Card)o).getName());
|
||||||
|
}
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private void doResolve(SpellAbility saMe)
|
private void doResolve(SpellAbility saMe)
|
||||||
{
|
{
|
||||||
int damage = getNumDamage(saMe);
|
int damage = getNumDamage(saMe);
|
||||||
|
|||||||
@@ -92,6 +92,11 @@ public class AbilityFactory_Pump {
|
|||||||
return doTgtAI(this);
|
return doTgtAI(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStackDescription(){
|
||||||
|
return pumpStackDescription(AF, this);
|
||||||
|
}
|
||||||
|
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
doResolve(this);
|
doResolve(this);
|
||||||
}//resolve
|
}//resolve
|
||||||
@@ -166,6 +171,11 @@ public class AbilityFactory_Pump {
|
|||||||
return super.canPlay();
|
return super.canPlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStackDescription(){
|
||||||
|
return pumpStackDescription(AF, this);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
doResolve(this);
|
doResolve(this);
|
||||||
@@ -314,6 +324,53 @@ public class AbilityFactory_Pump {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String pumpStackDescription(AbilityFactory af, SpellAbility sa){
|
||||||
|
// when damageStackDescription is called, just build exactly what is happening
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String name = af.getHostCard().getName();
|
||||||
|
|
||||||
|
ArrayList<Card> tgtCards;
|
||||||
|
Target tgt = AF.getAbTgt();
|
||||||
|
if (tgt != null)
|
||||||
|
tgtCards = tgt.getTargetCards();
|
||||||
|
else{
|
||||||
|
tgtCards = new ArrayList<Card>();
|
||||||
|
tgtCards.add(hostCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append(name).append(" - ");
|
||||||
|
for(Card c : tgtCards){
|
||||||
|
sb.append(c.getName());
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
final int atk = getNumAttack();
|
||||||
|
final int def = getNumDefense();
|
||||||
|
|
||||||
|
sb.append("gains ");
|
||||||
|
if (atk != 0 || def != 0){
|
||||||
|
if (atk >= 0)
|
||||||
|
sb.append("+");
|
||||||
|
sb.append(atk);
|
||||||
|
sb.append("/");
|
||||||
|
if (def >= 0)
|
||||||
|
sb.append("+");
|
||||||
|
sb.append(def);
|
||||||
|
sb.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Keywords.size() > 0)
|
||||||
|
{
|
||||||
|
for (int i=0; i<Keywords.size(); i++)
|
||||||
|
{
|
||||||
|
if (!Keywords.get(i).equals("none"))
|
||||||
|
sb.append(Keywords.get(i)).append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.append("until end of turn.");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private void doResolve(SpellAbility sa)
|
private void doResolve(SpellAbility sa)
|
||||||
{
|
{
|
||||||
ArrayList<Card> tgtCards;
|
ArrayList<Card> tgtCards;
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ public class Card extends MyObservable {
|
|||||||
private boolean copiedSpell = false;
|
private boolean copiedSpell = false;
|
||||||
private boolean SpellwithChoices = false;
|
private boolean SpellwithChoices = false;
|
||||||
private boolean SpellCopyingCard = false;
|
private boolean SpellCopyingCard = false;
|
||||||
private boolean checkedPropagandaThisTurn = false;
|
|
||||||
private boolean creatureAttackedThisCombat = false;
|
private boolean creatureAttackedThisCombat = false;
|
||||||
private boolean creatureBlockedThisCombat = false;
|
private boolean creatureBlockedThisCombat = false;
|
||||||
private boolean creatureGotBlockedThisCombat = false;
|
private boolean creatureGotBlockedThisCombat = false;
|
||||||
@@ -203,16 +202,6 @@ public class Card extends MyObservable {
|
|||||||
return xManaCostPaid;
|
return xManaCostPaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckedPropagandaThisTurn(boolean b)
|
|
||||||
{
|
|
||||||
checkedPropagandaThisTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getCheckedPropagandaThisTurn()
|
|
||||||
{
|
|
||||||
return checkedPropagandaThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
//used to see if an attacking creature with a triggering attack ability triggered this phase:
|
//used to see if an attacking creature with a triggering attack ability triggered this phase:
|
||||||
public void setCreatureAttackedThisCombat(boolean b) {
|
public void setCreatureAttackedThisCombat(boolean b) {
|
||||||
creatureAttackedThisCombat = b;
|
creatureAttackedThisCombat = b;
|
||||||
|
|||||||
@@ -831,7 +831,7 @@ public class CombatUtil {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(c.getController().isHuman()) {
|
if(c.getController().isHuman()) {
|
||||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Propaganda " + c + "\r\n",
|
AllZone.InputControl.setInput(new Input_PayManaCost_Ability(c + " - Pay to Attack\r\n",
|
||||||
ability.getManaCost(), paidCommand, unpaidCommand));
|
ability.getManaCost(), paidCommand, unpaidCommand));
|
||||||
} else //computer
|
} else //computer
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4081,7 +4081,7 @@ public class GameActionUtil {
|
|||||||
} else //computer
|
} else //computer
|
||||||
{
|
{
|
||||||
if(ComputerUtil.canPayCost(ability)) {
|
if(ComputerUtil.canPayCost(ability)) {
|
||||||
|
ComputerUtil.payManaCost(ability);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(c.getName()).append(" - return 1 creature from your graveyard to your hand");
|
sb.append(c.getName()).append(" - return 1 creature from your graveyard to your hand");
|
||||||
ability.setStackDescription(sb.toString());
|
ability.setStackDescription(sb.toString());
|
||||||
@@ -4273,7 +4273,6 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
Card c = list.get(i);
|
Card c = list.get(i);
|
||||||
if(c.getCheckedPropagandaThisTurn()) c.setCheckedPropagandaThisTurn(false);
|
|
||||||
if(c.getCreatureAttackedThisCombat()) c.setCreatureAttackedThisCombat(false);
|
if(c.getCreatureAttackedThisCombat()) c.setCreatureAttackedThisCombat(false);
|
||||||
if(c.getCreatureBlockedThisCombat()) c.setCreatureBlockedThisCombat(false);
|
if(c.getCreatureBlockedThisCombat()) c.setCreatureBlockedThisCombat(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user