mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 04:39:18 -08:00
try to use LKI if source == null
This commit is contained in:
parent
7bd38bb208
commit
757df393f9
2 changed files with 6 additions and 0 deletions
|
|
@ -92,6 +92,9 @@ class SpikeshotGoblinEffect extends OneShotEffect<SpikeshotGoblinEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (sourcePermanent == null) {
|
||||
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD);
|
||||
}
|
||||
if (sourcePermanent != null && permanent != null) {
|
||||
permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ class SpikeshotElderEffect extends OneShotEffect<SpikeshotElderEffect> {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (sourcePermanent == null) {
|
||||
sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Constants.Zone.BATTLEFIELD);
|
||||
}
|
||||
if (sourcePermanent != null && permanent != null) {
|
||||
permanent.damage(sourcePermanent.getPower().getValue(), source.getId(), game, true, false);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue