Implement statuses, GolemCharge, GolemBerserk, stun
This commit is contained in:
parent
caf782c884
commit
ef9ec43c8a
16 changed files with 260 additions and 38 deletions
|
|
@ -1,28 +1,41 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public class AcquireCardsEffect : IBattleEffect
|
||||
{
|
||||
private CardId[] cardIds;
|
||||
private int[] cardIds;
|
||||
private BattleZone zone;
|
||||
private BattleParticipant participant;
|
||||
|
||||
public AcquireCardsEffect(CardId cardId, BattleZone zone, BattleParticipant participant) {
|
||||
Initialize(new int[1] {(int) cardId}, zone, participant);
|
||||
}
|
||||
|
||||
public AcquireCardsEffect(CardId[] cardIds, BattleZone zone, BattleParticipant participant) {
|
||||
Initialize(cardIds.Cast<int>().ToArray(), zone, participant);
|
||||
}
|
||||
|
||||
public AcquireCardsEffect(MCardId mCardId, BattleZone zone, BattleParticipant participant) {
|
||||
Initialize(new int[1] {(int) mCardId}, zone, participant);
|
||||
}
|
||||
|
||||
public AcquireCardsEffect(MCardId[] mCardIds, BattleZone zone, BattleParticipant participant) {
|
||||
Initialize(mCardIds.Cast<int>().ToArray(), zone, participant);
|
||||
}
|
||||
|
||||
private void Initialize(int[] cardIds, BattleZone zone, BattleParticipant participant) {
|
||||
this.cardIds = cardIds;
|
||||
this.zone = zone;
|
||||
this.participant = participant;
|
||||
}
|
||||
|
||||
public void Apply(IBattleEffectResolver resolver) {
|
||||
if (this.participant.IsHero()) {
|
||||
resolver.AcquireHeroCards(this);
|
||||
} else {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
resolver.AcquireCards(this);
|
||||
}
|
||||
|
||||
public CardId[] CardIds {get => this.cardIds;}
|
||||
public int[] CardIds {get => this.cardIds;}
|
||||
public BattleZone Zone {get => this.zone;}
|
||||
public BattleParticipant Participant {get => this.participant;}
|
||||
}
|
||||
|
|
|
|||
30
Assets/Battle/Effects/StatusEffect.cs
Normal file
30
Assets/Battle/Effects/StatusEffect.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class StatusEffect : IBattleEffect
|
||||
{
|
||||
private BattleParticipant target;
|
||||
private BattleStatus status;
|
||||
private int amount;
|
||||
|
||||
public StatusEffect(BattleParticipant target, BattleStatus status) {
|
||||
this.target = target;
|
||||
this.status = status;
|
||||
this.amount = 1;
|
||||
}
|
||||
|
||||
public StatusEffect(BattleParticipant target, BattleStatus status, int amount) {
|
||||
this.target = target;
|
||||
this.status = status;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public void Apply(IBattleEffectResolver resolver) {
|
||||
resolver.AddStatus(this);
|
||||
}
|
||||
|
||||
public BattleParticipant Target {get => this.target;}
|
||||
public BattleStatus Status {get => this.status;}
|
||||
public int Amount {get => this.amount;}
|
||||
}
|
||||
11
Assets/Battle/Effects/StatusEffect.cs.meta
Normal file
11
Assets/Battle/Effects/StatusEffect.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b5c00b59e47f93143aae014a3351c16b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue