mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Adding DamageSource$ parameter for AF_DealDamage
- Adding Repentance as an example.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -5057,6 +5057,7 @@ res/cardsfolder/repay_in_kind.txt -text svneol=native#text/plain
|
|||||||
res/cardsfolder/repeal.txt -text svneol=native#text/plain
|
res/cardsfolder/repeal.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/repel.txt -text svneol=native#text/plain
|
res/cardsfolder/repel.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/repel_the_darkness.txt -text svneol=native#text/plain
|
res/cardsfolder/repel_the_darkness.txt -text svneol=native#text/plain
|
||||||
|
res/cardsfolder/repentance.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/repentant_blacksmith.txt -text svneol=native#text/plain
|
res/cardsfolder/repentant_blacksmith.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/repentant_vampire.txt -text svneol=native#text/plain
|
res/cardsfolder/repentant_vampire.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/repercussion.txt svneol=native#text/plain
|
res/cardsfolder/repercussion.txt svneol=native#text/plain
|
||||||
|
|||||||
10
res/cardsfolder/repentance.txt
Normal file
10
res/cardsfolder/repentance.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Name:Repentance
|
||||||
|
ManaCost:2 W
|
||||||
|
Types:Sorcery
|
||||||
|
Text:no text
|
||||||
|
A:SP$DealDamage | Cost$ 2 W | Tgt$ TgtC | DamageSource$ Targeted | NumDmg$ X | SpellDescription$ Target creature deals damage to itself equal to its power.
|
||||||
|
SVar:X:Targeted$CardPower
|
||||||
|
SVar:RemAIDeck:True
|
||||||
|
SVar:Rarity:Uncommon
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/repentance.jpg
|
||||||
|
End
|
||||||
@@ -123,7 +123,15 @@ public class AbilityFactory_DealDamage {
|
|||||||
if (!(sa instanceof Ability_Sub))
|
if (!(sa instanceof Ability_Sub))
|
||||||
sb.append(name).append(" - ");
|
sb.append(name).append(" - ");
|
||||||
|
|
||||||
sb.append("Deals ").append(dmg).append(" damage to ");
|
ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(sa.getSourceCard(), af.getMapParams().get("DamageSource"), sa);
|
||||||
|
Card source = definedSources.get(0);
|
||||||
|
|
||||||
|
if (source != sa.getSourceCard())
|
||||||
|
sb.append(source.toString()).append(" deals");
|
||||||
|
else
|
||||||
|
sb.append("Deals");
|
||||||
|
|
||||||
|
sb.append(" ").append(dmg).append(" damage to ");
|
||||||
|
|
||||||
for(int i = 0; i < tgts.size(); i++){
|
for(int i = 0; i < tgts.size(); i++){
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
@@ -495,14 +503,17 @@ public class AbilityFactory_DealDamage {
|
|||||||
|
|
||||||
boolean targeted = (AF.getAbTgt() != null);
|
boolean targeted = (AF.getAbTgt() != null);
|
||||||
|
|
||||||
|
ArrayList<Card> definedSources = AbilityFactory.getDefinedCards(saMe.getSourceCard(), params.get("DamageSource"), saMe);
|
||||||
|
Card source = definedSources.get(0);
|
||||||
|
|
||||||
for(Object o : tgts){
|
for(Object o : tgts){
|
||||||
if (o instanceof Card){
|
if (o instanceof Card){
|
||||||
Card c = (Card)o;
|
Card c = (Card)o;
|
||||||
if(AllZone.GameAction.isCardInPlay(c) && (!targeted || CardFactoryUtil.canTarget(AF.getHostCard(), c))) {
|
if(AllZone.GameAction.isCardInPlay(c) && (!targeted || CardFactoryUtil.canTarget(AF.getHostCard(), c))) {
|
||||||
if (noPrevention)
|
if (noPrevention)
|
||||||
c.addDamageWithoutPrevention(dmg, AF.getHostCard());
|
c.addDamageWithoutPrevention(dmg, source);
|
||||||
else
|
else
|
||||||
c.addDamage(dmg, AF.getHostCard());
|
c.addDamage(dmg, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -510,9 +521,9 @@ public class AbilityFactory_DealDamage {
|
|||||||
Player p = (Player) o;
|
Player p = (Player) o;
|
||||||
if (!targeted || p.canTarget(AF.getHostCard())) {
|
if (!targeted || p.canTarget(AF.getHostCard())) {
|
||||||
if (noPrevention)
|
if (noPrevention)
|
||||||
p.addDamageWithoutPrevention(dmg, AF.getHostCard());
|
p.addDamageWithoutPrevention(dmg, source);
|
||||||
else
|
else
|
||||||
p.addDamage(dmg, AF.getHostCard());
|
p.addDamage(dmg, source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user